summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/x11/display_server_x11.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-03-30 11:37:15 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2023-12-04 07:56:33 +0200
commitb02cf351f35f85fa2afcaa12b644b818a4252cfe (patch)
tree8100dfe024ec061936ca4b6c7eee95aa9aaf4fb3 /platform/linuxbsd/x11/display_server_x11.cpp
parentd76c1d0e516fedc535a2e394ab780cac79203477 (diff)
downloadredot-engine-b02cf351f35f85fa2afcaa12b644b818a4252cfe.tar.gz
[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
Diffstat (limited to 'platform/linuxbsd/x11/display_server_x11.cpp')
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 3bafdfb53d..9bd096640d 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -6108,7 +6108,8 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
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, p_flags, Rect2i(window_position, p_resolution));