mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add foreground window check
This commit is contained in:
parent
5be88dd386
commit
c63debe296
1 changed files with 6 additions and 2 deletions
|
|
@ -386,8 +386,12 @@ namespace Flow.Launcher.Infrastructure
|
||||||
// No installed English layout found
|
// No installed English layout found
|
||||||
if (enHKL == HKL.Null) return;
|
if (enHKL == HKL.Null) return;
|
||||||
|
|
||||||
// Get the current window thread ID
|
// Get the current foreground window
|
||||||
var threadId = PInvoke.GetWindowThreadProcessId(PInvoke.GetForegroundWindow());
|
var hwnd = PInvoke.GetForegroundWindow();
|
||||||
|
if (hwnd == HWND.Null) return;
|
||||||
|
|
||||||
|
// Get the current foreground window thread ID
|
||||||
|
var threadId = PInvoke.GetWindowThreadProcessId(hwnd);
|
||||||
if (threadId == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
|
if (threadId == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
|
||||||
|
|
||||||
// If the current layout has an IME mode, disable it without switching to another layout.
|
// If the current layout has an IME mode, disable it without switching to another layout.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue