On Tue, 11 Feb 2025 19:10:55 GMT, Damon Nguyen <dngu...@openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java 
>> line 1620:
>> 
>>> 1618:             do {
>>> 1619:                 // If application isn't in focus, stop the timer
>>> 1620:                 if (focusOwner == null) {
>> 
>> if (!scrollbar.isShowing()) {
>>           ((Timer)e.getSource()).stop();
>>           buttonListener.handledEvent = false;
>>           scrollbar.setValueIsAdjusting(false);
>>           return;
>>       }
>> 
>> 
>> I haven't tested this solution well, but you can try to stop the timer when 
>> the scrollbar is not showing(before entering the `do` loop)
>
> Tested this solution locally and in CI. Seems to work well. Clientlibs passes 
> and the updated, automatic test also passes on all related platforms. Updated 
> the PR. Thanks for providing the automated test and suggested change.

I agree, `!scrollbar.isShowing()` is a better condition to check for.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23451#discussion_r1956629137

Reply via email to