-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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()
is stuck on maximized window after changing mode
#84143
Comments
Assuming you mean |
my mistake, changed to |
Test 7: Test 8: those are 2 bugs which seem to be caused by maximized in the chain, Test 8 seems to be just a shortened version of test 7. |
DisplayServer.window_set_mode()
is stuck on maximized window after changing mode
@kkosovsky Can you reproduce the issue in 4.1.2 and earlier versions, or is this something new to 4.1.3? |
@Cyangmou Can you help and check in 4.1.2? Preferable stable. |
@YuriSizov I just tested with 4.1.1 and the same issue can be reproduced there. If necessary I can download 4.1.2 which I don't have, but given that the issue was reproducable in 4.1.1 and is still there in 4.1.3 I assume it also is in 4.1.2 Since I was just at it, i also tested at a single screen, as the initial test setup had 2 screens. |
Thanks for confirming that this is not a recent regression! 👍 |
Just wanted to add a few notes from things I've experienced related to window modes. In Godot 3, there were separate settings for all these things (fullscreen, borderless, maximized, etc.) When they got merged to one enum for 4.x is likely when the issue was introduced. I've also noticed that when lauching my game (at least from the editor), if there's a hitch or something, sometimes it fails to set the window mode. Happens pretty rarely, but I basically just have func _ready():
get_viewport().mode = Window.MODE_MAXIMIZED and sometimes it'll be windowed. Also, an issue I've experienced in both Godot 3 and 4 is that fullscreen will often happen on the wrong monitor. Setting the window to maximized before going fullscreen seems to fix this on both 3 and 4, like: func _ready():
get_viewport().mode = Window.MODE_MAXIMIZED
get_viewport().mode = Window.MODE_EXCLUSIVE_FULLSCREEN Regarding the bug at hand, glancing at the code, I think this block is the problem:
Should drop the else on the WINDOW_MODE_WINDOWED check, as the SW_RESTORE doesn't get executed. |
Yeah, looks like that's all it was. Did a quick PR here: #84504 |
Godot version
v4.1.3.rc1.official [f80c673]
System information
Windows 11, NVIDIA GeForce GTX 1070, i7-7700K CPU 4.20GHz, 1920x1080 60Hz IPS monitor & a 2560x1440 adaptive 100Hz monitor
Issue description
related to: #84142
Steps to reproduce
Test 1:
Window -> Maximized -> Window
window is small, correct
Test 2:
Window -> Maximized -> Fullscreen -> Window
Window is stuck at maximized, but according to test 1 should be normal size
NOT CORRECT
Test 3:
Window -> Maximized -> Fullscreen -> Exclusive Fullscreen -> Window
Window is stuck at maximized, but according to test 1 should be normal size
NOT CORRECT
Test 4
Window -> Maximized -> Exclusive Fullscreen -> Window
Window is stuck at maximized, but according to test 1 should be normal size
NOT CORRECT
Test 5:
Window -> Fullscreen -> Window
window is small, correct
Test 6:
Window -> Fullscreen -> Exclusive Fullscreen -> Window
window is small, correct
Conclusion:
Window mode is not disabling the maximized flag, if you go back from any fullscreen mode
Minimal reproduction project
window_mode_issue.zip
WindowModeTestsWindows11.mkv.zip
The text was updated successfully, but these errors were encountered: