-
-
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
Window node fullscreen mode not working #78530
Comments
I can't reproduce the issue on Linux (KDE on X11) with 4.0.3. Might be Windows specific? CC @bruvzg |
I can reproduce it on Windows 11 on the latest master (e74bf83) . I'll try taking a look! |
I think I figured out where the problem is. It starts inside the Window::_make_window function. The DisplayServer::get_singleton()->window_set_mouse_passthrough(mpath, window_id); call resets the Inside godot/platform/windows/display_server_windows.cpp Line 1000 in e74bf83
WM_WINDOWPOSCHANGED message (as mentioned in the MSDN docs). It is the handling of this message that ends up setting the wd.fullscreen property to false. It then fails to reset it to true because the next condition isn't met:
if (window_rect.position == screen_position && window_rect.size == screen_size) {
window.fullscreen = true;
} The handling of this message can be confirmed to be the culprit since commenting out the SetWindowRgn(windows[p_window].hWnd, nullptr, TRUE); line makes it so that the I' haven't been able to figure out what should be changed here. I'm not sure whether the Hope this helps someone with more knowledge than I have figure out what to do. |
Looking into it a bit more, it seems that the next portion of the if (window_rect.position == screen_position && window_rect.size == screen_size) {
window.fullscreen = true;
} Since in fullscreen mode there's a 1px border around the entire window, this comparisson fails since it compares Something that could be done is to detect when this kind of border is present and ignore it before comparing. Like this: RECT wrect;
GetWindowRect(hWnd, &wrect);
// In fullscreen mode, the window rect can have a 1px border around its full resolution, so ignore it for the rect comparissons.
if (wrect.left < 0){
int offset = wrect.left;
wrect.left -= offset;
wrect.right += offset;
}
if (wrect.top < 0){
int offset = wrect.top;
wrect.top -= offset;
wrect.bottom += offset;
} I tested adding the previous section of code and the issue dissapears. I also checked to see if #57787 re-appears with these changes but it doesn't. (It's the issue that was intended to be fixed by #57790) |
This should never happen (client rect can be 1 pixel smaller, but window size should be exact), so something else is wrong. |
Godot version
4.0.3.stable
System information
windows 11
Issue description
fullscreen on the window node is not working and will show up as a windowed.
Steps to reproduce
disable Embed Subwindows in Project Settings/Display/Window.
create a window node and set its mode to fullscreen.
Minimal reproduction project
fullscreen.zip
The text was updated successfully, but these errors were encountered: