x11: don't panic in request_user_attention when WM-hints send fails - #36
Draft
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On Linux/X11,
Window::request_user_attentionset the window's WM hints viaexpect_then_ignore_error, which panics when the request fails to send(for example, a dead X11 connection). Warp calls this to ring the terminal bell
while a window is inactive, so a dead connection at that moment aborted the whole
client — Sentry
WARP-CLIENT-BETA-STABLE-89S1.Change
Treat the send failure as recoverable:
Ok, keep ignoring the returned cookie exactly as before (cookie.ignore_error()).Err, log the failure withwarn!and carry on instead of panicking.This mirrors the existing error handling elsewhere in this file (e.g. the
flushfailure in
set_focus, which already logs rather than aborts).Verification
cargo check --features x11 --no-default-features— compiles clean.cargo clippy --features x11 --no-default-features— no warnings.No regression test is included: the panic only occurs when the X11 socket dies
mid-request, which is not reproducible in winit's test harness without a live X
server, and forcing it would require a production seam this fix does not warrant.