Theme Editor: fixed occasional empty window on startup on macOS

This commit is contained in:
Karl Tauber
2024-05-31 11:55:39 +02:00
parent f05df0db0a
commit 0eb77c7f72
2 changed files with 7 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ FlatLaf Change Log
`<big>`, `<small>` and `<samp>` in HTML text for components Button, CheckBox, `<big>`, `<small>` and `<samp>` in HTML text for components Button, CheckBox,
RadioButton, MenuItem (and subclasses), JideLabel, JideButton, JXBusyLabel and RadioButton, MenuItem (and subclasses), JideLabel, JideButton, JXBusyLabel and
JXHyperlink. Also fixed for Label and ToolTip if using Java 11+. JXHyperlink. Also fixed for Label and ToolTip if using Java 11+.
- Theme Editor: Fixed occasional empty window on startup on macOS.
#### Incompatibilities #### Incompatibilities

View File

@@ -929,6 +929,12 @@ class FlatThemeFileEditor
y = Math.max( Math.min( y, r.height - h ), r.y ); y = Math.max( Math.min( y, r.height - h ), r.y );
} }
// On macOS, the window may be empty if it spans the whole screen height
// and client property apple.awt.fullWindowContent is set to true.
// Invoking addNotify() before setting window bounds fixes this issue.
if( SystemInfo.isMacOS && !isDisplayable() )
addNotify();
setBounds( x, y, w, h ); setBounds( x, y, w, h );
return; return;
} catch( NumberFormatException ex ) { } catch( NumberFormatException ex ) {