x11: don't panic in request_user_attention when WM hints send fails - #38
Draft
Conversation
`Window::request_user_attention` set the urgency WM hint with `expect_then_ignore_error`, which panics if the request cannot be sent over the X11 connection. When the connection is dead this aborts the process (Warp Sentry WARP-CLIENT-BETA-STABLE-89S1) even though the caller only wanted to ring the bell / flag the window. Treat a send failure as recoverable: log a warning and return. On success the returned cookie is ignored exactly as before, so any resulting X error reply is still swallowed.
Draft
1 of 4 tasks
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.
On Linux/X11,
Window::request_user_attentionset the urgency WM hint withexpect_then_ignore_error, which calls.expect()on the send result and panics if the request cannot be written to the X11 connection. When the connection is dead, that panic aborts the whole process — Warp sees this as fatal crashWARP-CLIENT-BETA-STABLE-89S1, triggered simply by the terminal bell ringing while the window is inactive.This treats a failed send as recoverable: on
Errwe log a warning and return instead of panicking. OnOkthe returned cookie is stillignore_error()'d exactly as before, so any later X error reply is swallowed the same way and behavior on the healthy path is unchanged. Requesting user attention is best-effort, so dropping it on a broken connection is the right degradation.Applied on top of the commit Warp pins (
a4e0ecb5), which is the source for thewarpdotdev/v0.30.xpin. Consumed by warp via warpdotdev/warp-for-benchmarks#98, which bumps the pin to this commit.Testing
cargo check --no-default-features --features x11,rwh_06cargo clippy --no-default-features --features x11,rwh_06— cleancargo +nightly fmtNo automated regression test is included: reaching this branch requires a live
UnownedWindowbound to a dead X11 connection, and winit has no test seam to inject one without adding production-only plumbing. The change is a mechanical panic→log conversion that reuses the existingignore_error()idiom already used throughout this file.Checklist:
changelogmoduleThis PR was created by Warp (running Claude Code).