OSDN Git Service

Make CXkeymacsApp::Start64bitProcess wait until the child process starts
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Fri, 24 Aug 2012 03:19:16 +0000 (12:19 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Fri, 24 Aug 2012 03:19:16 +0000 (12:19 +0900)
This fixes a bug where XKeymacs drops any key type on 64bit applications
when it starts automatically just after reboot.

xkeymacs/xkeymacs.cpp

index 0833b65..585a1c9 100644 (file)
@@ -109,6 +109,9 @@ BOOL CXkeymacsApp::Start64bitProcess()
        ZeroMemory(&pi, sizeof(pi));\r
        if (!CreateProcess(path, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))\r
                return FALSE;\r
+       // wait until the child process starts.\r
+       if (WaitForInputIdle(pi.hProcess, INFINITE))\r
+               return FALSE;\r
        // close unused handles\r
        CloseHandle(pi.hProcess);\r
        CloseHandle(pi.hThread);\r