summaryrefslogtreecommitdiff
path: root/platform/linuxbsd
diff options
context:
space:
mode:
authorThomas ten Cate <ttencate@gmail.com>2023-02-14 12:15:14 +0100
committerThomas ten Cate <ttencate@gmail.com>2023-02-14 12:15:14 +0100
commit8a17f94ab2151eb5d953e4f2899c2b09cfa800f7 (patch)
treeb0117f2d1920f05f0f7c81abacdb10ddbca823a4 /platform/linuxbsd
parent4848877b802b17f4ab1aecfde42c81a7cc9b6f08 (diff)
Some fixes for initial window position and size
- X11: set main window position and size hints correctly - All platforms: update minimum and maximum size of main window at startup Fixes #70984
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 525c62fbf2..5d70af56bd 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -4936,6 +4936,11 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V
win_rect.position = wpos;
}
+ // Position and size hints are set from these values before they are updated to the actual
+ // window size, so we need to initialize them here.
+ wd.position = win_rect.position;
+ wd.size = win_rect.size;
+
{
wd.x11_window = XCreateWindow(x11_display, RootWindow(x11_display, visualInfo.screen), win_rect.position.x, win_rect.position.y, win_rect.size.width > 0 ? win_rect.size.width : 1, win_rect.size.height > 0 ? win_rect.size.height : 1, 0, visualInfo.depth, InputOutput, visualInfo.visual, valuemask, &windowAttributes);