From bf011f11dbac1b28e7cbfc15e1e60157a1c0bc84 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Sun, 23 Mar 2025 17:57:24 +0600 Subject: [PATCH] Revert "Fix keyboard restore issue when window is deactivated" This reverts commit 747f9582c3673a72eaf707e765f3badfc5af6674. --- Flow.Launcher/MainWindow.xaml.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index de15f30e8..2ce3d1e95 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -250,21 +250,11 @@ namespace Flow.Launcher private async void OnDeactivated(object sender, EventArgs e) { - // When window is deactivated, FL cannot set keyboard correctly - // This is a workaround to restore the keyboard layout - if (_settings.HideWhenDeactivated && _viewModel.StartWithEnglishMode) - { - Activate(); - QueryTextBox.Focus(); - Win32Helper.RestorePreviousKeyboardLayout(); - } - _settings.WindowLeft = Left; _settings.WindowTop = Top; ClockPanel.Opacity = 0; SearchIcon.Opacity = 0; - - // This condition stops extra hide call when animator is on, + //This condition stops extra hide call when animator is on, // which causes the toggling to occasional hide instead of show. if (_viewModel.MainWindowVisibilityStatus) { @@ -272,9 +262,8 @@ namespace Flow.Launcher // This also stops the mainwindow from flickering occasionally after Settings window is opened // and always after Settings window is closed. if (_settings.UseAnimation) - { + await Task.Delay(100); - } if (_settings.HideWhenDeactivated && !_viewModel.ExternalPreviewVisible) {