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

[macOS] Improve maximized and non-resizable modes handling. #69380

Merged
merged 1 commit into from
Dec 2, 2022

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Nov 30, 2022

There's no dedicated "maximized" window state on macOS. Zoom button is resizing it to max. allowed size (current screen size or max. window size). For non-resizable window, current size is max. size, so it's always considered to be zoomed by OS.

This PR replaces unreliable isZoomed with window/screen frame rect comparison to ensure set_size/position work with non-resizable windows and ignored for maximized windows (required for initial maximized window size to work correctly).

Also disables zoom button for non-resizable windows.

Fixes #69116

@pkdawson
Copy link
Contributor

pkdawson commented Dec 1, 2022

I encountered the same issue with borderless windows, because isZoomed always returns true for them. Confirmed that this fixes it.

@bruvzg bruvzg marked this pull request as ready for review December 2, 2022 06:36
@bruvzg bruvzg requested a review from a team as a code owner December 2, 2022 06:36
@akien-mga akien-mga merged commit 7bffdca into godotengine:master Dec 2, 2022
@akien-mga
Copy link
Member

Thanks!

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.

On OSX, DisplayServer.window_set_size() does not resize if display/window/size/resizable is false
3 participants