Skip to content

Commit

Permalink
Window decorations: fixed broken window resizing on Linux multi-scree…
Browse files Browse the repository at this point in the history
…n setups (issue #632)
  • Loading branch information
DevCharly committed Jan 2, 2023
1 parent 2134c19 commit 4b84435
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FlatLaf Change Log

#### Fixed bugs

- FlatLaf window decorations on Linux: Fixed broken window resizing on
multi-screen setups. (issue #632)
- IntelliJ Themes:
- Fixed default button hover background in "Solarized Light" theme. (issue
#628)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,10 @@ public void mouseDragged( MouseEvent e ) {
if( resizeDir == S_RESIZE_CURSOR || resizeDir == SW_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) {
newBounds.height = (yOnScreen + dragBottomOffset) - newBounds.y;
if( limitToParentBounds() ) {
int parentHeight = getParentBounds().height;
if( newBounds.y + newBounds.height > parentHeight )
newBounds.height = parentHeight - newBounds.y;
Rectangle parentBounds = getParentBounds();
int parentBottomY = parentBounds.y + parentBounds.height;
if( newBounds.y + newBounds.height > parentBottomY )
newBounds.height = parentBottomY - newBounds.y;
}
}

Expand All @@ -624,9 +625,10 @@ public void mouseDragged( MouseEvent e ) {
if( resizeDir == E_RESIZE_CURSOR || resizeDir == NE_RESIZE_CURSOR || resizeDir == SE_RESIZE_CURSOR ) {
newBounds.width = (xOnScreen + dragRightOffset) - newBounds.x;
if( limitToParentBounds() ) {
int parentWidth = getParentBounds().width;
if( newBounds.x + newBounds.width > parentWidth )
newBounds.width = parentWidth - newBounds.x;
Rectangle parentBounds = getParentBounds();
int parentRightX = parentBounds.x + parentBounds.width;
if( newBounds.x + newBounds.width > parentRightX )
newBounds.width = parentRightX - newBounds.x;
}
}

Expand Down

0 comments on commit 4b84435

Please sign in to comment.