diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index d26478bbe..54ae099f8 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -51,4 +51,9 @@ WM_EXITSIZEMOVE GetKeyboardLayout GetWindowThreadProcessId ActivateKeyboardLayout -GetKeyboardLayoutList \ No newline at end of file +GetKeyboardLayoutList + +PostMessage +HWND_BROADCAST +WM_INPUTLANGCHANGEREQUEST +INPUTLANGCHANGE_FORWARD diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index f23f02447..197a5a556 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -403,7 +403,11 @@ namespace Flow.Launcher.Infrastructure { if (_previousLayout == HKL.Null) return; - PInvoke.ActivateKeyboardLayout(_previousLayout, 0); + PInvoke.PostMessage(HWND.HWND_BROADCAST, + PInvoke.WM_INPUTLANGCHANGEREQUEST, + PInvoke.INPUTLANGCHANGE_FORWARD, + _previousLayout.Value + ); _previousLayout = HKL.Null; }