From d1da5985815db4ff05bb5badeec90565349adf50 Mon Sep 17 00:00:00 2001 From: fufesou Date: Sun, 4 Oct 2026 03:36:08 -0700 Subject: [PATCH] fix: share filtered shortcut bindings with the Web matcher Pass the active platform config to JavaScript at startup and after settings changes, preserving unsupported saved bindings in local storage. Signed-off-by: fufesou --- flutter/lib/web/bridge.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart index 242f5ebde..a8b1f21e2 100644 --- a/flutter/lib/web/bridge.dart +++ b/flutter/lib/web/bridge.dart @@ -993,10 +993,17 @@ class RustdeskImpl { } // Tell the JS-side matcher (flutter/web/js/src/shortcut_matcher.ts) to - // re-read its bindings from LocalStorage. Mirrors the native call which - // refreshes the Rust matcher's in-memory cache. + // use the same platform-filtered bindings as the Flutter matcher, while + // keeping unsupported saved bindings in LocalStorage. void mainReloadKeyboardShortcuts({dynamic hint}) { - js.context.callMethod('reloadShortcuts', []); + final config = ShortcutModel.config(active: true); + js.context.callMethod('reloadShortcuts', [ + jsonEncode({ + 'enabled': config.enabled, + 'pass_through': config.passThrough, + 'bindings': config.bindings, + }) + ]); } // Web has no Rust at runtime, so the defaults seed comes from the @@ -1263,6 +1270,7 @@ class RustdeskImpl { ShortcutModel.onWebTriggered(action); } }; + mainReloadKeyboardShortcuts(); return Future.value(); }