Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,18 @@ private Node createNavBar(Decorator skinnable, double leftPaneWidth, boolean can
}
if (onTitleBarDoubleClick != null)
center.setOnMouseClicked(onTitleBarDoubleClick);
center.setOnMouseDragged(mouseEvent -> {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This handler only handles the initial un-maximize action but doesn't consume the event or continue the drag. After un-maximizing, you should either consume the event or delegate to the existing onMouseDragged logic to ensure smooth continuous dragging. Without this, there's a disconnect between the un-maximize action and subsequent drag behavior.

Copilot uses AI. Check for mistakes.
if (!getSkinnable().isDragging() && primaryStage.isMaximized()) {
getSkinnable().setDragging(true);
mouseInitX = mouseEvent.getScreenX();
mouseInitY = mouseEvent.getScreenY();
primaryStage.setMaximized(false);
stageInitWidth = primaryStage.getWidth();
stageInitHeight = primaryStage.getHeight();
primaryStage.setY(stageInitY = 0);
primaryStage.setX(stageInitX = mouseInitX - stageInitWidth / 2);
Comment on lines +339 to +340
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic doesn't continue dragging after un-maximizing. After setting dragging to true and un-maximizing, the window is positioned but subsequent mouse movement won't move the window until the user releases and starts dragging again. The existing onMouseDragged handler (line 450) expects stageInitX and stageInitY to represent the initial stage position, not 0. Consider setting stageInitX and stageInitY to the calculated position values (mouseInitX - stageInitWidth / 2 and 0 respectively) after setting the stage position, so the subsequent dragging in onMouseDragged continues smoothly.

Suggested change
primaryStage.setY(stageInitY = 0);
primaryStage.setX(stageInitX = mouseInitX - stageInitWidth / 2);
double newStageY = 0;
double newStageX = mouseInitX - stageInitWidth / 2;
primaryStage.setY(newStageY);
primaryStage.setX(newStageX);
stageInitY = newStageY;
stageInitX = newStageX;

Copilot uses AI. Check for mistakes.
}
});
navBar.setCenter(center);

if (canRefresh) {
Expand Down
Loading