Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with moving maximized window in macOS #90101

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

Jiali-Qiu
Copy link
Contributor

@Jiali-Qiu Jiali-Qiu commented Apr 1, 2024

When opening the Godot editor and maximizing the window by double-clicking the title bar, users are unable to drag the window with the mouse.

With this commit, window_set_position allows the maximized window to be moved by dragging it. Only the fullscreen window won't be allowed to move.

Fixes #78758.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

This will make the window movable by any unprocessed mouse event, which is not a desired behavior.

What's preventing window move in maximized mode is this condition:

https://github.com/godotengine/godot/blob/master/platform/macos/display_server_macos.mm#L1998-L2000

It was added specifically to prevent moving maximized windows (probably to match behavior on the other platforms, I do not remember why it was done exactly).

@bruvzg
Copy link
Member

bruvzg commented Apr 1, 2024

The mentioned condition probably can be safely replaced with if (wd.fullscreen) { to fix moving maximized window.

@Jiali-Qiu Jiali-Qiu force-pushed the move-maximized-window branch from e56319b to ab00ee2 Compare April 1, 2024 16:05
When opening the Godot editor and maximizing the window by double-clicking the
title bar, users are unable to drag the window with the mouse.

With this commit, `window_set_position` allows the maximized window to be moved
by dragging it. Only the fullscreen window won't be allowed to move.

Fixes godotengine#78758.
@Jiali-Qiu Jiali-Qiu force-pushed the move-maximized-window branch from ab00ee2 to d78cb43 Compare April 1, 2024 16:11
@akien-mga akien-mga added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 4, 2024
@akien-mga akien-mga merged commit f8a1da9 into godotengine:master Apr 4, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga
Copy link
Member

Cherry-picked for 4.2.2.

@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to move editor window in macOS when Godot is maximized.
4 participants