RFR: 8344981: [REDO] JDK-6672644 JComboBox still scrolling if switch to another window and return back

Damon Nguyen dnguyen at openjdk.org
Thu Feb 6 17:15:14 UTC 2025


On Wed, 5 Feb 2025 07:39:52 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Redo for JComboBox infinite scrolling issue. The issue is that when a scrollbar is clicked and held, if the user switches focus (ex: ALT+TAB) while scrolling, when focused is returned to the scrolling application, the JComboBox will still be scrolling even though nothing it being clicked.
>> 
>> Previously, a KeyboardFocusListener was added to determine the focus. However, there was a memory leak on Windows and Ubuntu. This current implementation uses the current FocusManager and is overall a cleaner, simpler approach.
>
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java line 1625:
> 
>> 1623:                     scrollbar.setValueIsAdjusting(false);
>> 1624:                     return;
>> 1625:                 }
> 
> Can't it be merged with below frame disable logic as it does the same thing?

I initially separated it to make it clear that this is for focus. I'll edit this and modify the existing comment to include null focus.

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

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


More information about the client-libs-dev mailing list