fixed bug - careet in notepad and menu start OS
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user