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

Unable to move editor window in macOS when Godot is maximized. #78758

Closed
SNelson81 opened this issue Jun 27, 2023 · 3 comments · Fixed by #90101
Closed

Unable to move editor window in macOS when Godot is maximized. #78758

SNelson81 opened this issue Jun 27, 2023 · 3 comments · Fixed by #90101

Comments

@SNelson81
Copy link

SNelson81 commented Jun 27, 2023

Godot version

Godot v4.0.3 [Stable]

System information

macOS 13.4.1 - Godot v4.0.3 [Stable]

Issue description

If you open the Godot editor (it has to be the editor, the issue doesn't show on the project select screen) and maximize the window by double clicking the title bar, you can no longer drag the window with the mouse. Attached is a video of the issue.

To replicate:

  1. Open a project in the Godot editor.

  2. Double click the toolbar to maximize the window.

  3. Try and drag the window to move it and it won't move.

  4. If you drag a corner of the window to shrink it a little bit, then you can move it again.

It's almost as if the window thinks its in full screen mode verses maximize mode. Maximize mode is super useful for getting a full screen but being able to drag the window when needed to import assets or grab something from the desktop.

screenrecording.mp4

Steps to reproduce

To replicate:

  1. Open a project in the Godot editor.

  2. Double click the toolbar to maximize the window.

  3. Try and drag the window to move it and it won't move.

  4. If you drag a corner of the window to shrink it a little bit, then you can move it again.

Minimal reproduction project

N/A

@lostminds
Copy link

In 4.1.rc1 I can see the same issue. For me on macOS 13.4.1 when I open a project the editor window is maximized, and in this state the window can't be moved (same bug). And if I resize the window a little it I can move it again.

However, double-clicking the window title bar (I assume this is what you meant with toolbar?) does not maximize the window for me. Instead it minimizes the window to the dock. So I can only get the stuck maximized window state by restarting the editor (but also get it every time I open a project).

@geminax
Copy link

geminax commented Jun 29, 2023

However, double-clicking the window title bar (I assume this is what you meant with toolbar?) does not maximize the window for me. Instead it minimizes the window to the dock. So I can only get the stuck maximized window state by restarting the editor (but also get it every time I open a project).

The display server implementation for macos changes this behavior based on a user setting. Yours might be set to minimize as shown here: (I am on ventura 13.3.1)
image

As for the original issue, the issue seems to lie in changes made in this pr:
#69380

When you attempt to drag the window, the rects for the window frame and the screen visibleFrame are equal, and we return before any transformation. These rects do not seem to be equal in actual fullscreen mode of a mac window, so this doesn't seem like a reliable way to safeguard from inappropriate resizes/translations.

There certainly is also a fullscreen mode for windows which is set in the styleFlags of the NSWindow:

bool isFullscreen = (([wd.window_object styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);

I believe this might prove useful if trying to mitigate against moving/resizing a window that is deemed to be in "fullscreen".

Edit: There are also window delegates located in platform/macos/godot_window_delete.mm that can be useful in telling us whether a window entered/exited fullscreen. These are currently only connected to titlebar resizing.

@tkgalk
Copy link

tkgalk commented Jan 6, 2024

Bug still present in 4.2 and 4.3 dev 1.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 4, 2024
akien-mga pushed a commit to akien-mga/godot that referenced this issue Apr 8, 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 godotengine#78758.

(cherry picked from commit d78cb43)
DanielSnd pushed a commit to DanielSnd/godot that referenced this issue Apr 10, 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 godotengine#78758.
divshekhar pushed a commit to divshekhar/godot that referenced this issue Apr 23, 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 godotengine#78758.
MewPurPur pushed a commit to MewPurPur/godot that referenced this issue Jul 11, 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 godotengine#78758.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants