RFR: 8336879: Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground
Prasanta Sadhukhan
psadhukhan at openjdk.org
Wed Jul 24 06:15:30 UTC 2024
On Wed, 24 Jul 2024 05:12:17 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:
> In GTKPainter.paintPopupMenuBackground method, `img != null` condition will always be true, because it's only checked after `img.getRGB` method is called and that means img can't be `null`. So, the null check condition is removed. CI testing is ok.
src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java line 617:
> 615: if (border == img.getRGB(w / 2, h / 2)) {
> 616: // fix no menu borders in Adwaita theme
> 617: Graphics g2 = img.getGraphics();
I guess we can do `if (!isHw && img!=null)`
Also the comment that it is done for Adwaita theme, shouldn't then this code block be done in native after checking what theme is effective now, as this may affect Yaru or other theme potentially, no?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20308#discussion_r1689192916
More information about the client-libs-dev
mailing list