diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index f507785b7d..b218a0d79d 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -905,6 +905,7 @@ winMultiWindowWMProc(void *pArg) -- independently, the WM_TAKE_FOCUS protocol determines whether the WM should send a WM_TAKE_FOCUS ClientMessage. */ + if (pNode->msg.iWindow) { Bool neverFocus = FALSE; xcb_get_property_cookie_t cookie; @@ -928,6 +929,13 @@ winMultiWindowWMProc(void *pArg) pNode->msg.iWindow, pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus); + } + else + /* Set the input focus to none */ + { + xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_NONE, + XCB_NONE, XCB_CURRENT_TIME); + } break; diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 166d8fcdc1..4679ca58fd 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -808,9 +808,13 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* Remove our keyboard hook if it is installed */ winRemoveKeyboardHookLL(); - /* Revert the X focus as well, but only if the Windows focus is going to another window */ - if (!wParam && pWin) - DeleteWindowFromAnyEvents(pWin, FALSE); + /* Revert the X focus as well */ + if (fWMMsgInitialized) + { + wmMsg.msg = WM_WM_ACTIVATE; + wmMsg.iWindow = 0; + winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg); + } return 0;