Skip to content

Tolerate Escape grab conflict on X11 listener - #107

Open
prathamdby wants to merge 1 commit into
anomalyco:mainfrom
prathamdby:main
Open

prathamdby wants to merge 1 commit into
anomalyco:mainfrom
prathamdby:main

Conversation

@prathamdby

Copy link
Copy Markdown

Hey Anamoly team! I installed Hex on my machine, which runs on EndeavourOS, and I'm using i3wm with the ALT key as my $mod value and my Hex keybind set to CTRL + \, and while testing Hex, I ran into this problem below:

hex-escape-error

So, I asked my agent to fix it, and I tested the whole thing locally to ensure it works as you do expect. And now I'm able to use Hex flawlessly on my machine. So, I'm raising this PR in hopes of fixing it for anyone else who runs into the same situation. And I have also pasted a description of the entire PR made by my agent so you can understand the technical parts of it.

Description

  • The change makes the X11 Escape-cancel grab best-effort and keeps dictation running on conflict.
  • It treats only BadAccess as a grab conflict and keeps other grab errors fatal.
  • It adds classifier unit tests and documents the fix in recovery notes.
flowchart LR
  A["Hold hotkey Start"] --> B["Grab Escape for cancel"]
  B --> C{"Grab result"}
  C --> D["Success: enable Escape-cancel"]
  C --> E["BadAccess: warn, dictate without cancel"]
  C --> F["Other error: stop listener"]
Loading

Validation (CONTRIBUTING.md checklist, EndeavourOS i3/X11 host)

  • cargo fmt --check - clean
  • cargo test - 151 passed, 0 failed, 8 ignored (keyboard-layout test skips, macOS-only)
  • cargo clippy --all-targets --all-features -- -D warnings - clean
  • git diff --check - clean
  • Live check: held escape from a second X11 client; listener stayed Listening with no error; real dictation completed afterward

- Warn and continue without Escape-cancel on grab conflicts
- Keep non-conflict grab errors fatal with classifier tests
- Cover conflicted Escape dictation with ignored X11 test

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant