OSDN Git Service

Fix the bug where the hook state remains unchanged when IE10 or later has the keyboar...
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Sat, 22 Mar 2014 10:17:40 +0000 (19:17 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 11 Sep 2014 13:22:27 +0000 (22:22 +0900)
In xkeymacs-110830, the hook state remains unchanged when the keyboard
focus moves from another application to IE10 or later. After the change
of 55ddea2, the hook stays disabled in IE10 or later.

To change the hook state, CXkeymacsDll::CallWndProc calls
InitKeyboardProc when an appliation get the keyboard focus. It calls
only when the window is the foreground window. Each tab window in IE10
or later belong to a different process and does not become
foreground. So InitKeyboardProc is not called and the hook mode remains
unchanged.

To fix this bug, CallWndProc should call InitKeyboardProc even if the
focused window is not foreground.

xkeymacsdll/xkeymacsdll.cpp

index 57f072a..f49c0db 100644 (file)
@@ -270,11 +270,9 @@ LRESULT CALLBACK CXkeymacsDll::CallWndProc(int nCode, WPARAM wParam, LPARAM lPar
                        InitKeyboardProc();\r
                        break;\r
                case WM_SETFOCUS:\r
-                       if (cwps->hwnd == GetForegroundWindow()) {\r
-                               AppName::SetIMEState(false);\r
-                               InitKeyboardProc();\r
-                               ShowHookState();\r
-                       }\r
+                       AppName::SetIMEState(false);\r
+                       InitKeyboardProc();\r
+                       ShowHookState();\r
                        break;\r
                case WM_NCACTIVATE:\r
                        if (cwps->wParam && cwps->hwnd == GetForegroundWindow()) {\r