Skip to content

Commit

Permalink
Window decorations: support moving/resizing JInternalFrame that is …
Browse files Browse the repository at this point in the history
…child of `JLayeredPane` and overlaps FlatLaf title bar (issue #658)
  • Loading branch information
DevCharly committed Jul 9, 2023
1 parent 4344f1b commit c790778
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
Expand Down Expand Up @@ -952,6 +953,13 @@ protected void updateNativeTitleBarHeightAndHitTestSpots() {
}
}

// allow internal frames in layered pane to be moved/resized when placed over title bar
for( Component c : rootPane.getLayeredPane().getComponents() ) {
r = (c instanceof JInternalFrame) ? getNativeHitTestSpot( (JInternalFrame) c ) : null;
if( r != null )
hitTestSpots.add( r );
}

Rectangle minimizeButtonBounds = boundsInWindow( iconifyButton );
Rectangle maximizeButtonBounds = boundsInWindow( maximizeButton.isVisible() ? maximizeButton : restoreButton );
Rectangle closeButtonBounds = boundsInWindow( closeButton );
Expand Down

0 comments on commit c790778

Please sign in to comment.