mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 07:00:03 +01:00
Merge branch 'focus' into 'master'
hw/xwin: Improve multiwindow handling of focus moving to a native (non-X11) window Closes #1215 See merge request xorg/xserver!736
This commit is contained in:
commit
c650837726
2 changed files with 28 additions and 24 deletions
|
|
@ -909,6 +909,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;
|
||||
|
|
@ -922,7 +923,7 @@ winMultiWindowWMProc(void *pArg)
|
|||
}
|
||||
|
||||
if (!neverFocus)
|
||||
xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_POINTER_ROOT,
|
||||
xcb_set_input_focus(pWMInfo->conn, XCB_INPUT_FOCUS_PARENT,
|
||||
pNode->msg.iWindow, XCB_CURRENT_TIME);
|
||||
|
||||
if (IsWmProtocolAvailable(pWMInfo,
|
||||
|
|
@ -932,6 +933,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -803,6 +803,16 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
/* Add the keyboard hook if possible */
|
||||
if (g_fKeyboardHookLL)
|
||||
g_fKeyboardHookLL = winInstallKeyboardHookLL();
|
||||
|
||||
/* Tell our Window Manager thread to activate the window */
|
||||
if (fWMMsgInitialized)
|
||||
{
|
||||
wmMsg.msg = WM_WM_ACTIVATE;
|
||||
/* don't focus override redirect windows (e.g. menus) */
|
||||
if (!pWin || !pWin->overrideRedirect)
|
||||
winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
case WM_KILLFOCUS:
|
||||
|
|
@ -812,9 +822,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;
|
||||
|
||||
|
|
@ -898,26 +912,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
/* Pass the message to the root window */
|
||||
SendMessage(hwndScreen, message, wParam, lParam);
|
||||
|
||||
if (LOWORD(wParam) != WA_INACTIVE) {
|
||||
/* Raise the window to the top in Z order */
|
||||
/* ago: Activate does not mean putting it to front! */
|
||||
/*
|
||||
wmMsg.msg = WM_WM_RAISE;
|
||||
if (fWMMsgInitialized)
|
||||
winSendMessageToWM (s_pScreenPriv->pWMInfo, &wmMsg);
|
||||
*/
|
||||
|
||||
/* Tell our Window Manager thread to activate the window */
|
||||
wmMsg.msg = WM_WM_ACTIVATE;
|
||||
if (fWMMsgInitialized)
|
||||
if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
|
||||
winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
|
||||
}
|
||||
/* Prevent the mouse wheel from stalling when another window is minimized */
|
||||
if (HIWORD(wParam) == 0 && LOWORD(wParam) == WA_ACTIVE &&
|
||||
(HWND) lParam != NULL && (HWND) lParam != GetParent(hwnd))
|
||||
SetFocus(hwnd);
|
||||
return 0;
|
||||
/* Allow DefWindowProc to SetFocus() as needed */
|
||||
break;
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue