|
16 | 16 | using CommunityToolkit.Mvvm.DependencyInjection; |
17 | 17 | using Flow.Launcher.Core.Plugin; |
18 | 18 | using Flow.Launcher.Core.Resource; |
| 19 | +using Flow.Launcher.Helper; |
19 | 20 | using Flow.Launcher.Infrastructure; |
20 | 21 | using Flow.Launcher.Infrastructure.Hotkey; |
| 22 | +using Flow.Launcher.Infrastructure.Image; |
21 | 23 | using Flow.Launcher.Infrastructure.UserSettings; |
22 | 24 | using Flow.Launcher.Plugin.SharedCommands; |
23 | 25 | using Flow.Launcher.ViewModel; |
@@ -173,6 +175,9 @@ private async void OnLoaded(object sender, RoutedEventArgs _) |
173 | 175 | // Without this part, when shown for the first time, switching the context menu does not move the cursor to the end. |
174 | 176 | _viewModel.QueryTextCursorMovedToEnd = false; |
175 | 177 |
|
| 178 | + // Initialize hotkey mapper after window is loaded |
| 179 | + HotKeyMapper.Initialize(); |
| 180 | + |
176 | 181 | // View model property changed event |
177 | 182 | _viewModel.PropertyChanged += (o, e) => |
178 | 183 | { |
@@ -289,6 +294,7 @@ private async void OnClosing(object sender, CancelEventArgs e) |
289 | 294 | _notifyIcon.Visible = false; |
290 | 295 | App.API.SaveAppAllSettings(); |
291 | 296 | e.Cancel = true; |
| 297 | + await ImageLoader.WaitSaveAsync(); |
292 | 298 | await PluginManager.DisposePluginsAsync(); |
293 | 299 | Notification.Uninstall(); |
294 | 300 | // After plugins are all disposed, we can close the main window |
|
0 commit comments