Let a user-assigned Alt+Space shortcut beat the Windows system menu - #14547
Merged
Conversation
Subtitle Edit opens the Windows system menu itself on Alt+Space (Avalonia does not forward the chord to the default window procedure), via an app-wide tunnel-phase class handler on every Window plus an explicit call in the main key handler. Both ran before the shortcut lookup and marked the event handled, so a shortcut bound to Alt+Space never fired (#14536). Add IShortcutManager.HasShortcut and a per-window override registry in UiUtil: the main window claims Alt+Space while a shortcut is bound to it (mirroring the bare-F10 rule from #12504), and the shortcut key-capture window always claims it so the chord can be recorded. Everyone else keeps the system menu. Co-Authored-By: Claude Fable 5.1 <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.
Fixes #14536
Problem
Subtitle Edit opens the Windows system menu itself on Alt+Space (Avalonia does not forward the chord to the default window procedure). That handler is an app-wide tunnel-phase class handler on every
Window, plus an explicit call in the main key handler. Both ran before the shortcut lookup and marked the event handled, so a shortcut the user bound to Alt+Space (e.g. Auto-break text) never fired and the system menu appeared instead.Fix
IShortcutManager.HasShortcut(params string[] keys): order- and case-insensitive exact-chord lookup.UiUtil.SetWindowSystemMenuOverride(window, predicate): a window can claim Alt+Space for itself;TryHandleWindowSystemMenuthen leaves the event alone so normal shortcut handling runs.Tests
New
ShortcutsAltSpaceSystemMenuTestscover the lookup (order/case, supersets/subsets rejected) and assert the defaults never bind Alt+Space, so the system menu stays the out-of-the-box behaviour.🤖 Generated with Claude Code