diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-07-02 19:21:11 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-02-29 14:05:33 -0500 |
commit | e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684 (patch) | |
tree | 539a10cf1b3cd8ea88c177da84fd3f6d0a607bca | |
parent | 856a28f63739bffe32f5a8156fd2680e5c5259a1 (diff) |
xwin: In multiwindow mode, look up the HWND for the parent window
Rather than only looking at the foreground window to see if it matches
the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
the window privates.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 79ea108e5..8b857855f 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -523,9 +523,13 @@ winCreateWindowsWindow(WindowPtr pWin) if (winMultiWindowGetTransientFor(pWin, &daddyId)) { if (daddyId) { - hFore = GetForegroundWindow(); - if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP))) - hFore = NULL; + WindowPtr pParent; + int res = dixLookupWindow(&pParent, daddyId, serverClient, DixReadAccess); + if (res == Success) + { + winPrivWinPtr pParentPriv = winGetWindowPriv(pParent); + hFore = pParentPriv->hWnd; + } } } else { |