diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-03-30 11:37:15 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-12-04 07:56:33 +0200 |
commit | b02cf351f35f85fa2afcaa12b644b818a4252cfe (patch) | |
tree | 8100dfe024ec061936ca4b6c7eee95aa9aaf4fb3 /platform/macos/display_server_macos.mm | |
parent | d76c1d0e516fedc535a2e394ab780cac79203477 (diff) | |
download | redot-engine-b02cf351f35f85fa2afcaa12b644b818a4252cfe.tar.gz |
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
Diffstat (limited to 'platform/macos/display_server_macos.mm')
-rw-r--r-- | platform/macos/display_server_macos.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 2a6f17cb5d..94ef7ebc89 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -4563,7 +4563,8 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM if (p_screen == SCREEN_OF_MAIN_WINDOW) { p_screen = SCREEN_PRIMARY; } - window_position = screen_get_position(p_screen) + (screen_get_size(p_screen) - p_resolution) / 2; + Rect2i scr_rect = screen_get_usable_rect(p_screen); + window_position = scr_rect.position + (scr_rect.size - p_resolution) / 2; } WindowID main_window = _create_window(p_mode, p_vsync_mode, Rect2i(window_position, p_resolution)); |