Skip to content

x11: don't panic in request_user_attention when WM-hints send fails - #36

Draft
warp-agent-staging[bot] wants to merge 1 commit into
benchmark-run-97-trial-6858-attempt-1/01a0dac0-e5b0-7d21-913f-d853343a4ca8/winit-base-pin-a4e0ecb5from
benchmark-run-97-trial-6858-attempt-1/01a0dac0-e5b0-7d21-913f-d853343a4ca8/x11-request-user-attention-recoverable
Draft

warp-agent-staging[bot] wants to merge 1 commit into
benchmark-run-97-trial-6858-attempt-1/01a0dac0-e5b0-7d21-913f-d853343a4ca8/winit-base-pin-a4e0ecb5from
benchmark-run-97-trial-6858-attempt-1/01a0dac0-e5b0-7d21-913f-d853343a4ca8/x11-request-user-attention-recoverable

Conversation

@warp-agent-staging

Copy link
Copy Markdown

What

On Linux/X11, Window::request_user_attention set the window's WM hints via
expect_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:

  • On Ok, keep ignoring the returned cookie exactly as before (cookie.ignore_error()).
  • On Err, log the failure with warn! and carry on instead of panicking.

This mirrors the existing error handling elsewhere in this file (e.g. the flush
failure 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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants