From 870631211f507b302b3fbc289a62891115ad7a29 Mon Sep 17 00:00:00 2001 From: Dery Almas Date: Mon, 16 Feb 2026 19:59:56 +0100 Subject: [PATCH] Wayland: Skip resize request when the size is the same `DisplayServer::window_set_size` is called lots of times in the code, with the assumption (I suppose) that it's going to be idempotent. We had checks in _update_window_rect but we still called `WaylandThread::window_set_size`, which did a lot of stuff. In particular, this caused issues with HiDPI as it "overrode" the window size before it had a time to figure out its scale. --- platform/linuxbsd/wayland/display_server_wayland.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/linuxbsd/wayland/display_server_wayland.cpp b/platform/linuxbsd/wayland/display_server_wayland.cpp index 7b1caf904f..1297aa2dbb 100644 --- a/platform/linuxbsd/wayland/display_server_wayland.cpp +++ b/platform/linuxbsd/wayland/display_server_wayland.cpp @@ -1205,6 +1205,10 @@ void DisplayServerWayland::window_set_size(const Size2i p_size, DisplayServer::W ERR_FAIL_COND(!windows.has(p_window_id)); WindowData &wd = windows[p_window_id]; + if (wd.rect.size == p_size) { + return; + } + Size2i new_size = p_size; if (wd.visible) { new_size = wayland_thread.window_set_size(p_window_id, p_size);