Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
gpui: Fall back to client-side decorations on Wayland if SSD not supported (#39313)
Bea04b3d80c82b
diff --git a/crates/gpui/src/platform/linux/wayland/window.rs b/crates/gpui/src/platform/linux/wayland/window.rsindex c02d1f3bc3d..3334ae28a31 100644--- a/crates/gpui/src/platform/linux/wayland/window.rs+++ b/crates/gpui/src/platform/linux/wayland/window.rs@@ -1270,10 +1270,21 @@ impl PlatformWindow for WaylandWindow {fn request_decorations(&self, decorations: WindowDecorations) {let mut state = self.borrow_mut();- state.decorations = decorations;- if let Some(decoration) = state.surface_state.decoration() {- decoration.set_mode(decorations.to_xdg());- update_window(state);+ match state.surface_state.decoration().as_ref() {+ Some(decoration) => {+ decoration.set_mode(decorations.to_xdg());+ state.decorations = decorations;+ update_window(state);+ }+ None => {+ if matches!(decorations, WindowDecorations::Server) {+ log::info!(+ "Server-side decorations requested, but the Wayland server does not support them. Falling back to client-side decorations."+ );+ }+ state.decorations = WindowDecorations::Client;+ update_window(state);+ }}}