fixed bug - careet in notepad and menu start OS

This commit is contained in:
2026-08-08 23:00:37 +05:00
parent ba0748920b
commit 5ecc46f7a3
4 changed files with 113 additions and 33 deletions
+3 -4
View File
@@ -37,13 +37,12 @@ public sealed class KeyboardLayoutService : IKeyboardLayoutService, IDisposable
public event EventHandler<LayoutChangedEventArgs>? LayoutChanged;
public KeyboardLayout Current =>
KeyboardLayout.FromLocaleId(KeyboardLayoutNative.GetLocaleIdOf(KeyboardLayoutNative.GetForegroundWindow()));
public KeyboardLayout Current => KeyboardLayout.FromLocaleId(KeyboardLayoutNative.GetActiveLocaleId());
public void Start()
{
_lastForegroundWindow = KeyboardLayoutNative.GetForegroundWindow();
_lastLocaleId = KeyboardLayoutNative.GetLocaleIdOf(_lastForegroundWindow);
_lastLocaleId = KeyboardLayoutNative.GetActiveLocaleId();
_pollTimer.Start();
}
@@ -66,7 +65,7 @@ public sealed class KeyboardLayoutService : IKeyboardLayoutService, IDisposable
bool appSwitched = foreground != _lastForegroundWindow;
_lastForegroundWindow = foreground;
int localeId = KeyboardLayoutNative.GetLocaleIdOf(foreground);
int localeId = KeyboardLayoutNative.GetActiveLocaleId();
if (localeId == _lastLocaleId)
{
return;