Repository navigation
iris window: release held keys on focus loss; Right Cmd releases the grab on macOS - #183
Merged
techomancer merged 2 commits intoOct 7, 2026
Merged
Conversation
…ngrabs on macOS Cmd-Tab (or Alt-Tab) is pressed in the iris window and released in the next one, so the guest never saw the key-ups: whatever was held at that moment stayed down in IRIX. A stuck Shift made every Motif scrollbar ignore clicks (their translations exclude Shift) while menus still worked. The window now remembers the keys it sent the guest as pressed and, on Focused(false), sends their releases, clears the held mouse buttons and forgets Right Ctrl. iris-gui already lifts its held modifiers when it releases capture on focus loss. Mac keyboards have no Right Ctrl, the iris window's only way to release the grab; on macOS Right Cmd releases it too, and is not passed to the guest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atomchild411
marked this pull request as ready for review
October 7, 2026 05:29
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.
Problem
Switching away from the
iriswindow with Cmd-Tab (or Alt-Tab) leaves keys stuck down in the guest. The switch keys are pressed while the window has focus and released after it has gone, so iris never sends their key-ups — nor the key-up of anything else held at that moment. IRIX keeps the key held until it is pressed and released again.How it shows: with Shift stuck, every Motif scrollbar ignores clicks (their translations exclude Shift) while menus and lists keep working; with a stuck modifier, typed text comes out shifted. A mouse button held at the moment focus goes (mid-drag) stays down the same way. The README's note that Alt-tabbing away can garble keyboard input is this.
Separately: the
iriswindow's only way to release the grab is Right Ctrl, which Mac keyboards (every MacBook, the Magic Keyboard) don't have.Fix
One commit, in
src/ui.rs(theiriswindow only; iris-gui already lifts its held modifiers when it releases capture on focus loss):WindowEvent::Focused(false)it sends their releases, clears held mouse buttons (one PS/2 report with no buttons), and forgets Right Ctrl, then releases the grab as before.README (Input) and CHANGELOG updated.
Testing
cargo build --release,cargo test --release --lib: 887 passed.XQueryKeymapon the guest's X server showed Shift_L down and Motif scrollbars ignored clicks; releasing Shift_L (XTest) made them work again.🤖 Generated with Claude Code