Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix X11 window activation better (#13604)
Conrad Irwin6a1b257d3999
diff --git a/README.md b/README.mdindex a5ae33d0db6..0ab04b4362d 100644--- a/README.md+++ b/README.md@@ -1,5 +1,5 @@-# Zed-+a# Zed+sasdaasdasdasdasd[](https://github.com/zed-industries/zed/actions/workflows/ci.yml)Welcome to Zed, a high-performance, multiplayer code editor from the creators of [Atom](https://github.com/atom/atom) and [Tree-sitter](https://github.com/tree-sitter/tree-sitter).diff --git a/crates/gpui/src/platform/linux/x11/window.rs b/crates/gpui/src/platform/linux/x11/window.rsindex 34974156133..d77be6f34c5 100644--- a/crates/gpui/src/platform/linux/x11/window.rs+++ b/crates/gpui/src/platform/linux/x11/window.rs@@ -47,6 +47,7 @@ x11rb::atom_manager! {_NET_WM_STATE_FULLSCREEN,_NET_WM_STATE_HIDDEN,_NET_WM_STATE_FOCUSED,+ _NET_ACTIVE_WINDOW,_NET_WM_MOVERESIZE,_NET_WM_WINDOW_TYPE,_NET_WM_WINDOW_TYPE_NOTIFICATION,@@ -801,10 +802,21 @@ impl PlatformWindow for X11Window {}fn activate(&self) {- let win_aux = xproto::ConfigureWindowAux::new().stack_mode(xproto::StackMode::ABOVE);+ let data = [1, xproto::Time::CURRENT_TIME.into(), 0, 0, 0];+ let message = xproto::ClientMessageEvent::new(+ 32,+ self.0.x_window,+ self.0.state.borrow().atoms._NET_ACTIVE_WINDOW,+ data,+ );self.0.xcb_connection- .configure_window(self.0.x_window, &win_aux)+ .send_event(+ false,+ self.0.state.borrow().x_root_window,+ xproto::EventMask::SUBSTRUCTURE_REDIRECT | xproto::EventMask::SUBSTRUCTURE_NOTIFY,+ message,+ ).log_err();self.0.xcb_connection