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>
This commit is contained in:
		
							parent
							
								
									856a28f637
								
							
						
					
					
						commit
						e7f87f8f76
					
				| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue