RFR: 8367376: Bad ButtonUI prevents other components from updating when system changes desktop properties [v4]

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Sep 18 06:54:37 UTC 2025


On Wed, 17 Sep 2025 20:45:38 GMT, Jeremy Wood <jwood at openjdk.org> wrote:

>> Previously:
>> 
>> If DesktopProperty#updateAllUIs threw an exception, we would never reset the update-pending property to false. This means any subsequent call to `updateUI()` would not attempt to call `updateAllUIs()`
>> 
>> With this change:
>> Subsequent calls to DesktopProperty#updateUI() can still trigger at least one call to updateAllUIs().
>
> Jeremy Wood has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - 8367376: rename test file
>    
>    This is in response to:
>    https://github.com/openjdk/jdk/pull/27205#discussion_r2356674752
>  - 8367376: add new line to end of file
>    
>    This is in response to:
>    https://github.com/openjdk/jdk/pull/27205#discussion_r2356666306
>  - 8367376: changing field names
>    
>    This is in response to:
>    https://github.com/openjdk/jdk/pull/27205#discussion_r2356664929

src/java.desktop/share/classes/sun/swing/plaf/DesktopProperty.java line 222:

> 220:                         setUpdatePending(false);
> 221:                     }
> 222:                 }

I guess same thing we need to do here too

https://github.com/openjdk/jdk/blob/c96d09acd95d0ccf2fef50b8ccfeb5e2a0aa0968/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java#L2293-L2296

test/jdk/com/sun/java/swing/plaf/DesktopPropertyResetPendingFlagTest.java line 71:

> 69:         try {
> 70:             String lf = UIManager.getSystemLookAndFeelClassName();
> 71:             UIManager.setLookAndFeel(lf);

Guess we should iterate for all L&F s, not just test the default..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2357716063
PR Review Comment: https://git.openjdk.org/jdk/pull/27205#discussion_r2357716365


More information about the client-libs-dev mailing list