fix(overlay): reload imported mpv keys after mpv connects (#278)

* fix(overlay): reload imported mpv keys after mpv connects

The overlay fetched mpv's input-bindings before SubMiner connected to mpv,
cached an empty list, and never refetched because the connect-time refresh
only broadcast session bindings when their compiled signature changed. Keys
from input.conf and mpv defaults (9/0 volume, m mute) then did nothing while
the overlay had focus, most often in mpv.backend x11 mode.

Main now emits mpv-input-bindings:changed whenever the discovered mpv key
set or client changes, and the renderer refreshes its imported keys on it.

* fix(overlay): subscribe to mpv key changes before initial discovery

The renderer registered the mpv-input-bindings:changed listener only after awaiting setupMpvInputForwarding and several other startup calls. If mpv connected in that window, the event was dropped and the imported mpv keys stayed empty.
This commit is contained in:
sudacode authored and GitHub committed 2026-09-30 23:24:39 -07:00
1 parent 7b72dd2cc4
commit ffbbe698fc
10 files changed
+73 -2

No files matched your search

+3
View File
@@ -1335,6 +1335,9 @@ export function createKeyboardHandlers(
setupMpvInputForwarding,
refreshConfiguredShortcuts,
updateSessionBindings,
refreshMpvInputBindings: () => {
void importedMpvBindings.refresh();
},
syncKeyboardTokenSelection,
handleSubtitleContentUpdated,
togglePrimarySubtitleBarVisibility,