Repository navigation
Conversation
An editor for keyboard shortcuts (or a remote desktop viewer) needs the key combinations that the compositor would otherwise consume, while the editor window has focus. Add `window::inhibit_keyboard_shortcuts(id)`, which resolves to an `Inhibitor` handle or `None` on unsupported backends and closed windows, and `Action::InhibitKeyboardShortcuts`. The handle reports the actual focus and compositor permission (`Unfocused`, `Pending`, `Active`, `Inactive`, `Closed`) and offers one coalesced change stream; closing the window revokes retained clones. The `winit` shell implements it with winit's Wayland `inhibit_keyboard_shortcuts`. Requires winit's `WindowExtWayland::inhibit_keyboard_shortcuts`; `Cargo.toml` patches winit to the fork commit that provides it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Canopa fork tracking PR. Its diff against
canopa/base(595af03, the tip of upstream's0.14branch wheniced_widget0.14.2 was released.iced_winitandiced_runtimethere are identical to the 0.14.0 release,3997291) is exactly the change Canopa carries iniced_winit/iced_runtime. It is merged intocanopa/main, which Canopa builds. This PR stays open until the change is upstreamed or dropped.What
iced_runtime::window::keyboard_shortcuts:Inhibitorreports the actualStatus(Unfocused,Pending,Active,Inactive,Closed) and has one coalescedchanges()stream. ADrivertrait is provided for adapters. Window closure revokes retained clones.window::inhibit_keyboard_shortcuts(id) -> Task<Option<Inhibitor>>andAction::InhibitKeyboardShortcuts.iced_winit::keyboard_shortcuts: an adapter onto winit's Waylandinhibit_keyboard_shortcuts. Other backends returnNone.winit pin: the root
Cargo.tomladds[patch.crates-io] winit = { git = "https://github.com/kevinard/winit", rev = "7a606df981b5…" }, pointing at kevinard/winitcanopa/wayland-keyboard-shortcuts-inhibit(focus-scoped keyboard shortcut inhibition).Cargo.lockis updated to match.canopa/mainpins winit'scanopa/maininstead.Why
Canopa's GlobalShortcuts configuration editor must receive the keys it configures while existing registrations stay reserved. See Canopa ADR 0068.
Verification
cargo check --locked --all-targets -p iced_winit -p iced_runtime -p iced_test(default features) andcargo check --locked -p iced --no-default-features --features advanced,wgpu,crisp,web-colors,thread-pool,wayland,image(Canopa's selection) pass at this branch. The only warning is the pre-existingf32::INFINITYdeprecation iniced_widget.cargo test --locked -p iced_winit -p iced_runtime --libpasses, including the coalesced-change test forInhibitor.Upstream
Inventory verdict: upstream the inhibitor alone, which is this PR, and keep recording local. It depends on winit gaining the protocol (issue rust-windowing/winit#2776, open). The
[patch.crates-io]pin is fork-only and goes away once winit provides the API.🤖 Generated with Claude Code