Improve Ableton Live shortcut support - #153
Conversation
Full audit of Live 12 ch. 41/40 and Live 11 shortcuts against every key combination Wine intercepts. Root cause for the Alt+number report: Live swallows handled Alt chords, so defwnd.c's menu_sys_key static stays armed and the Alt release enters menu mode. Reproduced headless with tools/altnum-menu-repro.c under wine-staging 11.13; code identical in our tree and upstream master. Fix direction: disarm on the win32u input retrieval path, matching win32k queue-flag semantics. No patch shipped; Live verification matrix open.
Fixes the reported Alt+4 menu-bar activation: DefWindowProc's menu_sys_key stays armed when Live consumes a handled Alt chord, so the Alt release entered menu mode. Disarm on the win32u input retrieval path (process_keyboard_message, process_mouse_message), which sees every removed hardware message, matching win32k queue-flag semantics. Repro-verified on a patched 11.13 build tree: swallowed Alt+4 no longer arms the menu in either release order; Alt+letter mnemonics and bare Alt are unchanged; pass-through behavior identical. Full-series apply check against pristine wine-base-5c23dd1c passed. Real-Live verification still open, matrix in notes/ABLETON-WINE-SHORTCUT-PARITY.md. Repro tool grew mnemonic and bare-Alt preservation checks.
Four routes for the class D compositor collisions: launcher-managed gsettings save/strip/restore (recommended, opt-in, mechanism round-trip tested on GNOME Wayland), Mutter Xwayland grab whitelist (full takeover, needs a fork XGrabKeyboard patch, fullscreen-mode candidate), Wayland shortcuts inhibitor (needs winewayland, not our driver), documentation only. CtrlAlt+Delete logout collision for Live 11 confirmed bound by default.
ABLETON_SHORTCUTS=take (default preserve) saves the Ctrl+Alt workspace bindings, and for Live 11 sessions the Ctrl+Alt+Delete logout binding, to a per-prefix state file, strips only the Ctrl+Alt entries (Super variants stay), and restores them when Live exits via a detached watcher on the theme_watch_loop pattern. A state file found at launch with no Live running is restored first, so crashed sessions heal. GNOME-only, opt-in. Verified with the shipped functions on GNOME Wayland: strip cases, full hold/restore round trip returning exact original literals for all five keys, Live 12 key set excludes logout, watcher no-Live restore path. Not yet exercised around a real Live launch.
ClickSentinel
left a comment
There was a problem hiding this comment.
Reviewed at 150e642. Read 0070 against base-5c23dd1c; ran patch-check, a full build with build-audit, test-shortcut-hold.sh, and A/B probes on a scratch Xvfb display against the installed 0001-0065 runtime. Live was not in the loop, and this box is COSMIC, so the GNOME hold was exercised through the library's own functions and real gsettings get values.
Verified. patch-check clean (67 entries, series applies to pristine base). Build clean, build-audit 4/4, series 0001..0070. Merge against main: already up to date. 37/37 shortcut-hold checks. altnum-menu-repro before/after: swallow prohibited=9 exit 1 -> prohibited=0 exit 0, pass identical in both, alt_f={1,1,1} and bare_alt={1,1} green in all four runs. 0069 is the only other delta in that A/B and touches window.c alone, so the difference is 0070's. The Alt+click exposure the audit lists as unobserved is now observed: unpatched, the swallowed click arms the bar and the follow-up F opens File.
Blocking
- Hold does not survive losing
XDG_RUNTIME_DIR. The snapshot lives only at$XDG_RUNTIME_DIR/ableton-wine-shortcuts/hold-v2(shortcut-hold.sh:97-112). That path is tmpfs and goes with the session; dconf does not. A reboot or logout with Live running destroys the snapshot while the stripped bindings persist, and no later launch can recover them - Ctrl+Alt+Up/Down are gone permanently, silently. Measured with the shipped test's own gsettings stub: hold -> wipe the runtime dir -> relaunch leavesup=['<Super>Up'] down=[]. Both docs promise the opposite ("restore them after a crash", "the next launch finds the saved values"). Fix: snapshot under${XDG_STATE_HOME:-$HOME/.local/state}/ableton-wine/, leave locks andlease.*in the runtime dir. The existing no-Live-no-lease rule then heals across reboots unchanged.
Should fix
f10_keybehaviour is not unchanged for pass-through apps, and nothing tests it. The patch message claims it is;altnum-menu-repro.chas no F10 stage. Measured on a pass-through window:F10 down/uparms in both runtimes,F10 down, A down, A up, F10 uparms in neither,F10 down, A down, F10 up, A uparms before and not after. Base only breaks the arm on the intervening keyup (defwnd.c:2789), so this ordering genuinely changes - plausibly toward Windows per the patch's ownQF_FMENUSTATUSBREAKpremise, which I could not verify independently. Fix: narrow the claim to the Alt path, and add that third case to the repro.- 0070 has no off switch. It rewrites the input retrieval path for every process under the runtime - plugin GUIs, Max, the installer - and swapping whole runtimes was the only way to A/B it. Precedent is mixed (0055/0062/0065/0069 have one, 0049-0054 do not), but this one sits on the hot path for every message. Fix: gate both
cancel_menu_key_state()calls on aWINE_WIN32_MENU_KEY_BREAK=offread once.
Comment only
- Audit note's line anchors do not resolve against
base-5c23dd1cas it states - button-down clear is basedefwnd.c:2749cited 2758, arm2760cited 2768, keyupSC_KEYMENU2786cited 2795;message.cis mixed. Mechanism verified correct, anchors only. Fix: re-cite, or say which tree they are from. ABLETON_SHORTCUTStreats anything not exactlytakeaspreservewith no message, whereABLETON_TOPBAR_MODEwarns (ableton-live:760).=Takeor=onwould look like it worked. Fix: one warn line.SERIES_GAPS[0057]is stale - 0057 ships and fingerprints, but is still listed as reserved. The numbering loop only consults the table for genuinely missing numbers, so it passes silently. Pre-existing. Fix: drop the entry.altnum-menu-repro.exetakes the foreground and issuesSendInputkey and button events; BUILDING.md says only that it needs a working Wine display. Fix: one sentence pointing atxvfb-run.
Held
menu_sys_key is armed only from DefWindowProc (defwnd.c:2760) and fires at keyup (:2786), so a consumed chord key reaches neither - the mechanism is as described. Both insertion points are right: the keyboard cancel lands after VK_LMENU/VK_RMENU fold to VK_MENU and before dispatch, so bare Alt and F10 still arm; the mouse cancel lands while msg->message is still the untranslated button-down (reassigned only at message.c:2809), so it covers non-client and double-click cases. WM_SYSCHAR never reads the flag, only clears it (:2793), which is why mnemonics survive. No other patch in the series touches either static. The strip parser is correct against this box's real values, including keeping '<Super><Alt>Left' while removing '<Control><Alt>Left' from the same array.
This change improves keyboard and mouse shortcuts in Ableton Live when Live
runs through this project's Wine build.
It includes:
ABLETON_SHORTCUTS=take ableton-livecan temporarily turn off the exactGNOME Ctrl+Alt+Up and Ctrl+Alt+Down entries. For Live 11, it also turns off
the exact Ctrl+Alt+Delete entry.
It also recovers after a stopped process and keeps shortcut changes that the
user makes while Live runs.
The automatic desktop change supports GNOME only. It does not change KDE or
another desktop. This change also does not alter AltGr behavior.
The saved tests check exact GNOME entry matching, recovery, handled Alt keys,
Alt with a mouse action, Alt+F, and Alt by itself. The Wine test returns an
error when a required result fails.
The short guide is in
notes/ABLETON-WINE-SHORTCUT-PARITY.md. The detailedresearch and open checks are kept in
notes/ABLETON-WINE-SHORTCUT-AUDIT.md.