We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9dd5f06 commit eec6145Copy full SHA for eec6145
Flow.Launcher.Infrastructure/Win32Helper.cs
@@ -376,7 +376,8 @@ public static unsafe void SwitchToEnglishKeyboardLayout(bool backupPrevious)
376
if (!IsForegroundWindow(hwnd))
377
{
378
var result = PInvoke.SetForegroundWindow(hwnd);
379
- if (!result) throw new Win32Exception(Marshal.GetLastWin32Error());
+ // If we cannot set the foreground window, we can use the foreground window and switch the layout
380
+ if (!result) hwnd = PInvoke.GetForegroundWindow();
381
}
382
383
// Get the current foreground window thread ID
0 commit comments