FlatLaf window decorations: fixed sometimes broken window moving with SplitPane in window title area in "full window content" mode (issue #926)

This commit is contained in:
Karl Tauber
2024-12-04 18:21:06 +01:00
parent 3f33543cee
commit 1dcb251ecb
2 changed files with 13 additions and 1 deletions

View File

@@ -1109,8 +1109,18 @@ public class FlatTitlePane
// if component is not fully layouted, do not invoke function
// because it is too dangerous that the function tries to layout the component,
// which could cause a dead lock
if( !c.isValid() )
if( !c.isValid() ) {
// revalidate if necessary so that it is valid when invoked again later
EventQueue.invokeLater( () -> {
Window w = SwingUtilities.windowForComponent( c );
if( w != null )
w.revalidate();
else
c.revalidate();
} );
return false; // assume that this is not a caption because the component has mouse listeners
}
if( caption instanceof Function ) {
// check client property function value