[NtUser]
authorJames Tabor <james.tabor@reactos.org>
Thu, 11 Aug 2016 22:04:33 +0000 (22:04 +0000)
committerJames Tabor <james.tabor@reactos.org>
Thu, 11 Aug 2016 22:04:33 +0000 (22:04 +0000)
- If focus window null use active.

svn path=/trunk/; revision=72202

reactos/win32ss/user/ntuser/kbdlayout.c

index 396e6e3..b903b5f 100644 (file)
@@ -410,6 +410,7 @@ static PKL
 co_UserActivateKbl(PTHREADINFO pti, PKL pKl, UINT Flags)
 {
     PKL pklPrev;
+    PWND pWnd;
 
     pklPrev = pti->KeyboardLayout;
     if (pklPrev)
@@ -424,8 +425,13 @@ co_UserActivateKbl(PTHREADINFO pti, PKL pKl, UINT Flags)
         // FIXME
     }
 
+    if (!(pWnd = pti->MessageQueue->spwndFocus))
+    {
+         pWnd = pti->MessageQueue->spwndActive;
+    }
+
     // Send WM_INPUTLANGCHANGE to thread's focus window
-    co_IntSendMessage(pti->MessageQueue->spwndFocus ? UserHMGetHandle(pti->MessageQueue->spwndFocus) : 0,
+    co_IntSendMessage( pWnd ? UserHMGetHandle(pWnd) : 0,
                       WM_INPUTLANGCHANGE,
                       (WPARAM)pKl->iBaseCharset, // FIXME: How to set it?
                       (LPARAM)pKl->hkl); // hkl