Compare commits

...

2 Commits

Author SHA1 Message Date
Karl Tauber
5e4f00f0c8 GitHub Actions: build using Java 25 LTS
Some checks failed
CI / build (11) (push) Has been cancelled
CI / build-on (17, ) (push) Has been cancelled
CI / build-on (21, ) (push) Has been cancelled
CI / build-on (21, 25) (push) Has been cancelled
CI / build-on (8, ) (push) Has been cancelled
CI / snapshot (push) Has been cancelled
CI / release (push) Has been cancelled
2025-09-23 16:15:08 +02:00
Karl Tauber
15cbf28a0d Popup: no longer reuse popup windows for menus to avoid immediately closing dialogs on ChromeOS (issue #1029)
added system property `flatlaf.reuseVisiblePopupWindow`
2025-09-20 12:51:50 +02:00
4 changed files with 30 additions and 6 deletions

View File

@@ -67,11 +67,10 @@ jobs:
- 8 - 8
- 17 # LTS - 17 # LTS
- 21 # LTS - 21 # LTS
- 23 # latest
toolchain: [""] toolchain: [""]
# include: include:
# - java: 21 - java: 21
# toolchain: 22 # latest toolchain: 25 # LTS
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View File

@@ -15,6 +15,8 @@ FlatLaf Change Log
- Tree and List: Fixed painting of rounded drop backgrounds. (issue #1023) - Tree and List: Fixed painting of rounded drop backgrounds. (issue #1023)
- Popup: Showing tooltip in inactive window brought that window to front (made - Popup: Showing tooltip in inactive window brought that window to front (made
it active) and potentially hid the previously active window. (issue #1037) it active) and potentially hid the previously active window. (issue #1037)
- Popup: No longer reuse popup windows for menus to avoid immediately closing
dialogs on ChromeOS. (issue #1029)
- macOS: Fixed window "flashing" when switching from a light to a dark theme (or - macOS: Fixed window "flashing" when switching from a light to a dark theme (or
vice versa). Especially when using animated theme changer (see vice versa). Especially when using animated theme changer (see
[FlatLaf Extras](flatlaf-extras)). [FlatLaf Extras](flatlaf-extras)).

View File

@@ -16,6 +16,7 @@
package com.formdev.flatlaf; package com.formdev.flatlaf;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import com.formdev.flatlaf.util.UIScale; import com.formdev.flatlaf.util.UIScale;
@@ -147,6 +148,25 @@ public interface FlatSystemProperties
*/ */
String USE_ROUNDED_POPUP_BORDER = "flatlaf.useRoundedPopupBorder"; String USE_ROUNDED_POPUP_BORDER = "flatlaf.useRoundedPopupBorder";
/**
* Species whether popup windows may be reused without (temporary) hiding them.
* E.g. if "moving" a tooltip to follow the mouse pointer, normally it is necessary
* to hide the tooltip and show it again at the new location, which causes some
* flicker with heavy-weight popup windows that FlatLaf uses on all platforms.
* <p>
* If {@code true}, hiding popup window is deferred for an event cycle,
* which allows reusing still visible popup window and avoids flicker when "moving" the popup.
* <p>
* Note that {@link JPopupMenu} popup windows (menus and combobox lists) are newer reused.
* <p>
* <strong>Allowed Values</strong> {@code false} and {@code true}<br>
* <strong>Default</strong> {@code true}
*
* @since 3.7
*/
String REUSE_VISIBLE_POPUP_WINDOW = "flatlaf.reuseVisiblePopupWindow";
/** /**
* Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens. * Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens.
* <p> * <p>

View File

@@ -676,8 +676,11 @@ public class FlatPopupFactory
return; return;
disposed = true; disposed = true;
// immediately hide non-heavy weight popups or combobox popups // immediately hide non-heavy weight popups, popup menus and combobox popups
if( !(popupWindow instanceof JWindow) || contents instanceof BasicComboPopup ) { // of if system property is false
if( !(popupWindow instanceof JWindow) || contents instanceof JPopupMenu ||
!FlatSystemProperties.getBoolean( FlatSystemProperties.REUSE_VISIBLE_POPUP_WINDOW, true ) )
{
hideImpl(); hideImpl();
return; return;
} }