From fa45bb63c6579b5cb7d09c457aa6480516ae725c Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 4 Jul 2023 13:09:26 +0300 Subject: [PATCH] [Windows] Fix setting initial non-exclusive window mode. (cherry picked from commit db0109b23713cc9ebdb6f8efb1097874fda81113) --- platform/windows/display_server_windows.cpp | 4 +++- scene/main/window.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index b0b1e1680fc..4138f53a9d9 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -3926,7 +3926,9 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, WindowRect.top += offset.y; WindowRect.bottom += offset.y; - AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle); + if (p_mode != WINDOW_MODE_FULLSCREEN && p_mode != WINDOW_MODE_EXCLUSIVE_FULLSCREEN) { + AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle); + } WindowID id = window_id_counter; { diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 0aa6b69d6c7..be88b757fd9 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -2653,7 +2653,7 @@ void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("popup_exclusive_centered_clamped", "from_node", "minsize", "fallback_ratio"), &Window::popup_exclusive_centered_clamped, DEFVAL(Size2i()), DEFVAL(0.75)); // Keep the enum values in sync with the `Mode` enum. - ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Windowed,Minimized,Maximized,Fullscreen"), "set_mode", "get_mode"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Windowed,Minimized,Maximized,Fullscreen,Exclusive Fullscreen"), "set_mode", "get_mode"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title");