RFR: 8336879: Always true condition 'img != null' in GTKPainter.paintPopupMenuBackground [v2]

Abhishek Kumar abhiscxk at openjdk.org
Thu Jul 25 04:31:34 UTC 2024


On Thu, 25 Jul 2024 04:01:03 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.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comment fix

> 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?

Ran the test mentioned in [JDK-8160160](https://bugs.openjdk.org/browse/JDK-8160160) and observed the same issue for Yaru theme as well where border is not drawn if this part of code is commented. So, I think the effect should be same for Adwaita, Yaru and other themes.

Adwaita_No_Border
![Adwaita_No_Border](https://github.com/user-attachments/assets/bfcc361a-3e14-4a60-931c-bf08e8449bd4)

Yaru_No_Border
![Yaru_No_Border](https://github.com/user-attachments/assets/036d63f7-60c4-42b1-9221-a11939a37480 )

Adwaita_With_Border
![Adwaita_With_Border](https://github.com/user-attachments/assets/3db06640-9266-4b9e-9a3c-89bd4a22d258) 

Yaru_With_Border
![Yaru_With_Border](https://github.com/user-attachments/assets/57aa8945-8a4e-4945-a29e-d0c224ada410)

However I am unable to run the JCK test with the option `-server -d64 -Xmixed` mentioned in [JDK-8160160](https://bugs.openjdk.org/browse/JDK-8160160).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20308#issuecomment-2249355593


More information about the client-libs-dev mailing list