From 6a1b257d399982c3f7aaedb4c6a0471a9753b215 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 27 Jun 2024 14:36:29 -0600 Subject: [PATCH] Fix X11 window activation better (#13604) Release Notes: - N/A --- README.md | 4 ++-- crates/gpui/src/platform/linux/x11/window.rs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a5ae33d0db..0ab04b4362 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Zed - +a# Zed +sasdaasdasdasdasd [![CI](https://github.com/zed-industries/zed/actions/workflows/ci.yml/badge.svg)](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.rs index 3497415613..d77be6f34c 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