summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-10-05 17:56:32 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2017-10-05 17:56:32 +0100
commit767219bca4a558459b443875106191d124aac320 (patch)
tree1ab0f7265b608d55f31cf157d3961154bbe41a36
parentc2763093a8231f885800f0f4fd0a0d8cda571b1c (diff)
Revert "Always set the X input focus to none when an X window loses focus."
-rw-r--r--hw/xwin/winmultiwindowwm.c8
-rw-r--r--hw/xwin/winmultiwindowwndproc.c10
2 files changed, 3 insertions, 15 deletions
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 9069690aa..f3ccfb2fc 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1116,7 +1116,6 @@ 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;
@@ -1141,13 +1140,6 @@ winMultiWindowWMProc(void *pArg)
pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus);
}
- else
- /* Set the input focus to none */
- {
- xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_NONE,
- XCB_INPUT_FOCUS_NONE, XCB_CURRENT_TIME);
-
- }
break;
case WM_WM_NAME_EVENT:
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 881746af5..ee3d1637e 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -847,13 +847,9 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Remove our keyboard hook if it is installed */
winRemoveKeyboardHookLL();
- /* Revert the X focus as well */
- if (fWMMsgInitialized)
- {
- wmMsg.msg = WM_WM_ACTIVATE;
- wmMsg.iWindow = 0;
- winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
- }
+ /* Revert the X focus as well, but only if the Windows focus is going to another window */
+ if (!wParam && pWin)
+ DeleteWindowFromAnyEvents(pWin, FALSE);
return 0;