File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -250,20 +250,31 @@ private void OnLocationChanged(object sender, EventArgs e)
250
250
251
251
private async void OnDeactivated ( object sender , EventArgs e )
252
252
{
253
+ // When window is deactivated, FL cannot set keyboard correctly
254
+ // This is a workaround to restore the keyboard layout
255
+ if ( _settings . HideWhenDeactivated && _viewModel . StartWithEnglishMode )
256
+ {
257
+ Activate ( ) ;
258
+ QueryTextBox . Focus ( ) ;
259
+ Win32Helper . RestorePreviousKeyboardLayout ( ) ;
260
+ }
261
+
253
262
_settings . WindowLeft = Left ;
254
263
_settings . WindowTop = Top ;
255
264
ClockPanel . Opacity = 0 ;
256
265
SearchIcon . Opacity = 0 ;
257
- //This condition stops extra hide call when animator is on,
266
+
267
+ // This condition stops extra hide call when animator is on,
258
268
// which causes the toggling to occasional hide instead of show.
259
269
if ( _viewModel . MainWindowVisibilityStatus )
260
270
{
261
271
// Need time to initialize the main query window animation.
262
272
// This also stops the mainwindow from flickering occasionally after Settings window is opened
263
273
// and always after Settings window is closed.
264
274
if ( _settings . UseAnimation )
265
-
275
+ {
266
276
await Task . Delay ( 100 ) ;
277
+ }
267
278
268
279
if ( _settings . HideWhenDeactivated && ! _viewModel . ExternalPreviewVisible )
269
280
{
You can’t perform that action at this time.
0 commit comments