From 382d0c2bfe85416185d9ffcebfc0d9ab68065f31 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Sun, 23 Mar 2025 18:26:11 +0600 Subject: [PATCH] Don't broadcast language change --- Flow.Launcher.Infrastructure/NativeMethods.txt | 1 - Flow.Launcher.Infrastructure/Win32Helper.cs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index 54ae099f8..833c6682b 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -54,6 +54,5 @@ ActivateKeyboardLayout GetKeyboardLayoutList PostMessage -HWND_BROADCAST WM_INPUTLANGCHANGEREQUEST INPUTLANGCHANGE_FORWARD diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 197a5a556..7bb9df2e7 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -403,7 +403,9 @@ namespace Flow.Launcher.Infrastructure { if (_previousLayout == HKL.Null) return; - PInvoke.PostMessage(HWND.HWND_BROADCAST, + var hwnd = PInvoke.GetForegroundWindow(); + PInvoke.PostMessage( + hwnd, PInvoke.WM_INPUTLANGCHANGEREQUEST, PInvoke.INPUTLANGCHANGE_FORWARD, _previousLayout.Value