From 05e9fc9a6cabe9e39c8062740e56319f8b3204b5 Mon Sep 17 00:00:00 2001 From: "warp-agent-staging[bot]" <240773466+warp-agent-staging[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2026 22:51:58 +0000 Subject: [PATCH] Fix X11 panic in request_user_attention on dead connection On Linux/X11, Window::request_user_attention set the window's WM hints with expect_then_ignore_error, which panics if the request fails to send (e.g. a dead X connection). This aborted Warp while it was ringing the terminal bell in the background (Sentry WARP-CLIENT-BETA-STABLE-89S1). Treat the send failure as recoverable: log it and continue. On success, keep ignoring the returned cookie as before. --- src/changelog/unreleased.md | 2 ++ src/platform_impl/linux/x11/window.rs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/changelog/unreleased.md b/src/changelog/unreleased.md index cb8e6a6727..6ab1cde7b0 100644 --- a/src/changelog/unreleased.md +++ b/src/changelog/unreleased.md @@ -51,6 +51,8 @@ changelog entry. when not called from inside the event loop. Now queues a microtask instead. - On Windows, prevent incorrect shifting when dragging window onto a monitor with different DPI. +- On X11, don't panic in `Window::request_user_attention` when the connection + is dead; log the send failure and carry on. ### Removed diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index 1acca0b1d0..72305085f5 100644 --- a/src/platform_impl/linux/x11/window.rs +++ b/src/platform_impl/linux/x11/window.rs @@ -1814,9 +1814,10 @@ impl UnownedWindow { .unwrap_or_default(); wm_hints.urgent = request_type.is_some(); - wm_hints - .set(self.xconn.xcb_connection(), self.xwindow as xproto::Window) - .expect_then_ignore_error("Failed to set WM hints"); + match wm_hints.set(self.xconn.xcb_connection(), self.xwindow as xproto::Window) { + Ok(cookie) => cookie.ignore_error(), + Err(e) => warn!("failed to send WM hints when requesting user attention: {e}"), + } } #[inline]