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 {