From e7f87f8f76e5ac9479a71e3daf2cfdefd4b5f684 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 2 Jul 2015 19:21:11 +0100 Subject: [PATCH] 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 Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwindow.c | 10 +++++++--- 1 file 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 {