From 968587a7456b89ed9cefc1be91b1ebf97ec6158e Mon Sep 17 00:00:00 2001 From: marius851000 Date: Thu, 3 Jul 2025 11:26:00 +0200 Subject: [PATCH] worspace: Add partial window bound fix when switching between CSD and SSD on Wayland (#31335) Partial fix for #31330 It fix the problem that the inset stay on after switching to SSD, but it still have the problem that after that first redraw, it have the wrong size. Just resizing it even once work. I guess the relevant code to fix that would be ``handle_toplevel_decoration_event`` of ``crates/gpui/src/platform/linux/wayland/window.rs``, but trying to call resize here does not seems to work correctly (might be just wrong argument), and I would like to take a break on that for now. Release Notes: - N/A (better wait for that to be completely fixed before adding it in the changelog) --------- Co-authored-by: Michael Sloan --- crates/workspace/src/workspace.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 91d0a20178718fb9118f4386af4bc3944ea9546f..141cd36efd94689d2f45ec303bcb2851f174aec3 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -7561,6 +7561,7 @@ fn parse_pixel_size_env_var(value: &str) -> Option> { Some(size(px(width as f32), px(height as f32))) } +/// Add client-side decorations (rounded corners, shadows, resize handling) when appropriate. pub fn client_side_decorations( element: impl IntoElement, window: &mut Window, @@ -7569,8 +7570,9 @@ pub fn client_side_decorations( const BORDER_SIZE: Pixels = px(1.0); let decorations = window.window_decorations(); - if matches!(decorations, Decorations::Client { .. }) { - window.set_client_inset(theme::CLIENT_SIDE_DECORATION_SHADOW); + match decorations { + Decorations::Client { .. } => window.set_client_inset(theme::CLIENT_SIDE_DECORATION_SHADOW), + Decorations::Server { .. } => window.set_client_inset(px(0.0)), } struct GlobalResizeEdge(ResizeEdge);