From f9b69aeff0f043810b7b98c6242663db76611341 Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Wed, 17 Dec 2025 16:44:25 -0600 Subject: [PATCH] Fix Wayland platform resize resulting in non-interactive window (#45153) Closes #40361 Release Notes: - Linux(Wayland): Fixed an issue where the settings window would not respond to user interaction until resized --- .../gpui/src/platform/linux/wayland/window.rs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/crates/gpui/src/platform/linux/wayland/window.rs b/crates/gpui/src/platform/linux/wayland/window.rs index 3334ae28a31927b2150e79fc513855fa699c55ba..8cc47c3c139708c3cc278c6146411a4383cc0004 100644 --- a/crates/gpui/src/platform/linux/wayland/window.rs +++ b/crates/gpui/src/platform/linux/wayland/window.rs @@ -1025,13 +1025,26 @@ impl PlatformWindow for WaylandWindow { fn resize(&mut self, size: Size) { let state = self.borrow(); let state_ptr = self.0.clone(); - let dp_size = size.to_device_pixels(self.scale_factor()); + + // Keep window geometry consistent with configure handling. On Wayland, window geometry is + // surface-local: resizing should not attempt to translate the window; the compositor + // controls placement. We also account for client-side decoration insets and tiling. + let window_geometry = inset_by_tiling( + Bounds { + origin: Point::default(), + size, + }, + state.inset(), + state.tiling, + ) + .map(|v| v.0 as i32) + .map_size(|v| if v <= 0 { 1 } else { v }); state.surface_state.set_geometry( - state.bounds.origin.x.0 as i32, - state.bounds.origin.y.0 as i32, - dp_size.width.0, - dp_size.height.0, + window_geometry.origin.x, + window_geometry.origin.y, + window_geometry.size.width, + window_geometry.size.height, ); state