On X11, don't panic in request_user_attention when WM hints fail to send - #37
Conversation
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 <noreply@anthropic.com>
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 X11,
Window::request_user_attentionset the urgency WM hint throughexpect_then_ignore_error, which panics if the request fails to send — forexample when the X11 connection is dead. Warp rings the terminal bell while a
window is inactive via
request_user_attention, so a dead connection at thatmoment aborts the whole process (Sentry
WARP-CLIENT-BETA-STABLE-89S1).Consumed by warpdotdev/warp-for-benchmarks#100, which points Warp's winit pin at this revision.
Treat the send failure as recoverable: on error, log it via
warn!and carryon; on success, keep ignoring the reply cookie exactly as before. Matching the
Resultmirrors how neighbouring X11 code (e.g. the focus path) alreadytolerates transient connection failures.
Testing
cargo check --no-default-features --features x11,rwh_06passes. The X11platform backend has no mock-connection test harness (its only unit tests cover
pure parsing), so a regression test for the dead-connection send path would
require inventing connection-mocking infrastructure that does not exist; the fix
is a local change from panic to log-and-continue and is verified by inspection
and by the build.
changelogmodule if knowledge of this change could be valuable to usersThis PR was created by Warp (running Claude Code).