https://git.reactos.org/?p=reactos.git;a=commitdiff;h=433240feec504b337d331…
commit 433240feec504b337d3317c9fa1b85e8c571b967
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Oct 29 16:23:58 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sat Oct 29 16:23:58 2022 +0900
[KBSWITCH] Follow-up of #4815 (36f7d1a); Less flicker Alt+Shift
Add bNoActivate argument to ActivateLayout function.
CORE-11700, CORE-2699, CORE-18546
---
base/applications/kbswitch/kbswitch.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/base/applications/kbswitch/kbswitch.c
b/base/applications/kbswitch/kbswitch.c
index 5bad013d964..4f6baa7dc54 100644
--- a/base/applications/kbswitch/kbswitch.c
+++ b/base/applications/kbswitch/kbswitch.c
@@ -401,7 +401,7 @@ EnumWindowsProc(HWND hwnd, LPARAM lParam)
}
static VOID
-ActivateLayout(HWND hwnd, ULONG uLayoutNum, HWND hwndTarget OPTIONAL)
+ActivateLayout(HWND hwnd, ULONG uLayoutNum, HWND hwndTarget OPTIONAL, BOOL bNoActivate)
{
HKL hKl;
TCHAR szLayoutNum[CCH_ULONG_DEC + 1], szLCID[CCH_LAYOUT_ID + 1],
szLangName[MAX_PATH];
@@ -419,7 +419,7 @@ ActivateLayout(HWND hwnd, ULONG uLayoutNum, HWND hwndTarget OPTIONAL)
GetLocaleInfo(LangID, LOCALE_SLANGUAGE, szLangName, ARRAYSIZE(szLangName));
UpdateTrayIcon(hwnd, szLCID, szLangName);
- if (hwndTarget)
+ if (hwndTarget && !bNoActivate)
SetForegroundWindow(hwndTarget);
hKl = LoadKeyboardLayout(szLCID, KLF_ACTIVATE);
@@ -671,7 +671,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
AddTrayIcon(hwnd);
- ActivateLayout(hwnd, ulCurrentLayoutNum, NULL);
+ ActivateLayout(hwnd, ulCurrentLayoutNum, NULL, FALSE);
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
break;
}
@@ -775,13 +775,13 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
ulCurrentLayoutNum = uNum;
}
- ActivateLayout(hwnd, GetNextLayout(), hwndTarget);
+ ActivateLayout(hwnd, GetNextLayout(), hwndTarget, TRUE);
/* FIXME: CONWND is multithreaded but KLF_SETFORPROCESS and
DefWindowProc.WM_INPUTLANGCHANGEREQUEST won't work yet
*/
if (bCONWND)
{
- ActivateLayout(hwnd, ulCurrentLayoutNum, hwndTargetSave);
+ ActivateLayout(hwnd, ulCurrentLayoutNum, hwndTargetSave, TRUE);
}
break;
}
@@ -794,7 +794,7 @@ WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
g_hwndLastActive = NULL;
}
- ActivateLayout(hwnd, LOWORD(wParam), g_hwndLastActive);
+ ActivateLayout(hwnd, LOWORD(wParam), g_hwndLastActive, FALSE);
}
break;
}