From 044dc2c5ea7a2ea5dbdfff0180f3acd28994bd88 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 18 Mar 2025 12:05:58 +0800 Subject: [PATCH] Fix hotkey initialization issue --- Flow.Launcher/HotkeyControl.xaml.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index c47e86ff10d..678280bbaf2 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -214,13 +214,14 @@ public HotkeyControl() HotkeyList.ItemsSource = KeysToDisplay; - RefreshHotkeyInterface(Hotkey); + // We should not call RefreshHotkeyInterface here because DependencyProperty is not set yet + // And it will be called in OnHotkeyChanged event or Hotkey setter later } private void RefreshHotkeyInterface(string hotkey) { - SetKeysToDisplay(new HotkeyModel(Hotkey)); - CurrentHotkey = new HotkeyModel(Hotkey); + SetKeysToDisplay(new HotkeyModel(hotkey)); + CurrentHotkey = new HotkeyModel(hotkey); } private static bool CheckHotkeyAvailability(HotkeyModel hotkey, bool validateKeyGesture) =>