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.

(cherry picked from commit 870631211f507b302b3fbc289a62891115ad7a29)
This commit is contained in:
Dery Almas
2026-02-16 19:59:56 +01:00
committed by Thaddeus Crews
parent 1eee336361
commit 8054ff5d03
@@ -1204,6 +1204,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);