1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

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
This commit is contained in:
Thomas ten Cate
2023-02-14 12:15:14 +01:00
parent 4848877b80
commit 8a17f94ab2
2 changed files with 6 additions and 0 deletions

View File

@@ -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);