diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-29 09:04:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 09:04:53 +0200 |
commit | 7e1e0f496bbc92f85061182c6c201d41c4cc52ac (patch) | |
tree | ebddc58391c4e68633f6999f162c4716cb6f88d6 /platform/windows | |
parent | e23bd5a1cb0f17ca6085359a4e87d58d80bcceaa (diff) | |
parent | 63a00aec68fe875efd875265e30c3ed1c475a95f (diff) |
Merge pull request #37802 from ThakeeNathees/window-position-bug-osx-x11
display server window position bug fix
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/display_server_windows.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 4d4273a073..e4fe7f04d0 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2897,7 +2897,10 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win } } #endif - WindowID main_window = _create_window(p_mode, 0, Rect2i(Point2i(), p_resolution)); + Point2i window_position( + (screen_get_size(0).width - p_resolution.width) / 2, + (screen_get_size(0).height - p_resolution.height) / 2); + WindowID main_window = _create_window(p_mode, 0, Rect2i(window_position, p_resolution)); for (int i = 0; i < WINDOW_FLAG_MAX; i++) { if (p_flags & (1 << i)) { window_set_flag(WindowFlags(i), true, main_window); |