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]