Windows: Perform keyboard layout switching whenever window focus is gained or lost.

git-svn-id: https://svn.eduke32.com/eduke32@5972 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2016-12-26 06:02:53 +00:00
parent fefd94d8ef
commit 0b75ca3ec1
3 changed files with 6 additions and 0 deletions

View file

@ -2293,6 +2293,8 @@ int32_t handleevents_pollsdl(void)
if (mousegrab && moustat)
grabmouse_low(appactive);
#ifdef _WIN32
Win_SetKeyboardLayoutUS(appactive);
if (backgroundidle)
SetPriorityClass(GetCurrentProcess(), appactive ? NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS);
#endif

View file

@ -570,6 +570,8 @@ int32_t handleevents_pollsdl(void)
if (mousegrab && moustat)
grabmouse_low(!!appactive);
# ifdef _WIN32
Win_SetKeyboardLayoutUS(appactive);
if (backgroundidle)
SetPriorityClass(GetCurrentProcess(),
appactive ? NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS);

View file

@ -3541,6 +3541,8 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
}
#endif
Win_SetKeyboardLayoutUS(appactive);
if (backgroundidle)
SetPriorityClass(GetCurrentProcess(),
appactive ? NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS);