From 0275fd001c469c0321c38fd3cce7cbd876cb1179 Mon Sep 17 00:00:00 2001 From: "warp-agent-staging[bot]" <240773466+warp-agent-staging[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:15:08 +0000 Subject: [PATCH] On X11, don't panic when request_user_attention fails to send WM hints Window::request_user_attention set the urgency WM hints via expect_then_ignore_error, which panics if the request fails to send (for example when the X11 connection is dead). Ringing the terminal bell while the window is inactive could therefore abort the process. Treat the send failure as recoverable: log the error and continue, while still ignoring the reply cookie on success as before. Co-Authored-By: Claude Opus 4.8 --- 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..ac6b6e9d05 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 setting the WM + hints fails to send; the error is now logged and ignored. ### Removed diff --git a/src/platform_impl/linux/x11/window.rs b/src/platform_impl/linux/x11/window.rs index 1acca0b1d0..730515a7b5 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 set WM hints: {e}"), + } } #[inline]