Skip to content

Commit

Permalink
project manager window position bug fix: godotengine#37323
Browse files Browse the repository at this point in the history
  • Loading branch information
ThakeeNathees committed Mar 29, 2020
1 parent 307b1b3 commit 5c7d1b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2858,7 +2858,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(
(GetSystemMetrics(SM_CXSCREEN) - p_resolution.x) / 2,
(GetSystemMetrics(SM_CYSCREEN) - p_resolution.y) / 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);
Expand Down

0 comments on commit 5c7d1b3

Please sign in to comment.