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

DisplayServer.window_set_mode has several issues [MacOS] #84142

Open
kkosovsky opened this issue Oct 29, 2023 · 4 comments
Open

DisplayServer.window_set_mode has several issues [MacOS] #84142

kkosovsky opened this issue Oct 29, 2023 · 4 comments

Comments

@kkosovsky
Copy link

Godot version

4.1.1.stable, 4.1.2.stable

System information

MacOS Ventura - Apple M2 Max - Metal 3 - Compatibility Renderer

Issue description

There are serious problems with changing window mode through DisplayServer's window_set_mode function.
image

window_mode_issue.mov
window_mode_test_1.mov

There are several cases of unexpected behavior. More in steps to reproduce.

Steps to reproduce

Test 1:
Window -> Maximized -> Window
CORRECT

Test 2:
Window -> Maximized -> Fullscreen
The window behaves oddly between Maxmized -> Fullscreen mode change. It looks like it's going to window mode between maximized and fullscreen.
INCORRECT

Test 3:
Window -> Maximized -> Exclusive Fullscreen
Same as Test 2.
INCORRECT

Test 3:
Window -> Maximized -> Fullscreen -> Window
Window has correct size.
CORRECT

Test 4:
Window -> Fullscreen -> Exclusive Fullscreen
Instead of going from Fullscreen to Exclusive Fullscreen it goes back to Window.
INCORRECT

Test 5:
Window -> Fullscreen -> Exclusive Fullscreen -> Window
Then after changing to Window, it goes to fullscreen
INCORRECT

Test 6:
Window -> Fullscreen -> Exclusive Fullscreen -> Window -> Exclusive Fullscreen
Then after changing to Fullscreen it goes back to window.
INCORRECT

Minimal reproduction project

window_mode_issue.zip

@bruvzg
Copy link
Member

bruvzg commented Oct 29, 2023

The window behaves oddly between Maxmized -> Fullscreen mode change. It looks like it's going to window mode between maximized and fullscreen.

That's expected, otherwise it won't be able to restore window size when exiting full-screen.

@bruvzg bruvzg self-assigned this Oct 29, 2023
@kkosovsky
Copy link
Author

kkosovsky commented Oct 29, 2023

The window behaves oddly between Maxmized -> Fullscreen mode change. It looks like it's going to window mode between maximized and fullscreen.

That's expected, otherwise it won't be able to restore window size when exiting full-screen.

Yes, but it shouldn't go to small window size and then to fullscreen. There shouldn't be an in between size, as I imagine it.

@jitspoe
Copy link
Contributor

jitspoe commented Nov 9, 2023

I've fixed the maximized->fullscreen->windowed mode bug specifically for Windows here: https://github.com/godotengine/godot/pull/84504/files

Pretty trivial fix. I'm assuming the same logic error exists for Mac as well (else if (p_mode == WINDOW_MODE_WINDOWED) just needs the else removed), but I don't have a mac to build and test on. If any mac devs want to make a contribution, this should be an easy one! :)

@bruvzg
Copy link
Member

bruvzg commented Nov 9, 2023

I'm assuming the same logic error exists for Mac as well (else if (p_mode == WINDOW_MODE_WINDOWED) just needs the else removed)

This will break switching maximizefullscreenwindow switch (macOS do not have real maximized state, so exiting full-screen will return it to previous window size).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants