From 0b75ca3ec1fd39d3a4c1fc72d4bde71f40988aae Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 26 Dec 2016 06:02:53 +0000 Subject: [PATCH] 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 --- polymer/eduke32/build/src/sdlayer.c | 2 ++ polymer/eduke32/build/src/sdlayer12.c | 2 ++ polymer/eduke32/build/src/winlayer.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 92901ac2c..cd311613b 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -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 diff --git a/polymer/eduke32/build/src/sdlayer12.c b/polymer/eduke32/build/src/sdlayer12.c index 6d6da9079..d7528cbc4 100644 --- a/polymer/eduke32/build/src/sdlayer12.c +++ b/polymer/eduke32/build/src/sdlayer12.c @@ -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); diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 719599609..5a9bb526a 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -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);