mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-02 15:28:07 +02:00
Fix window cascading to not affect popups or menus
This commit is contained in:
parent
78cc1a5768
commit
559610b8a2
3 changed files with 45 additions and 4 deletions
|
|
@ -229,10 +229,46 @@ winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints)
|
|||
else
|
||||
prop = prop->next;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
|
||||
{
|
||||
struct _Window *pwin;
|
||||
struct _Property *prop;
|
||||
|
||||
if (!pWin)
|
||||
{
|
||||
ErrorF ("winMultiWindowGetTransientFor - pWin was NULL\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pwin = (struct _Window*) pWin;
|
||||
|
||||
if (pwin->optional)
|
||||
prop = (struct _Property *) pwin->optional->userProps;
|
||||
else
|
||||
prop = NULL;
|
||||
|
||||
if (ppDaddy)
|
||||
*ppDaddy = NULL;
|
||||
|
||||
while (prop)
|
||||
{
|
||||
if (prop->propertyName == XA_WM_TRANSIENT_FOR)
|
||||
{
|
||||
if (ppDaddy)
|
||||
memcpy (*ppDaddy, prop->data, sizeof (WindowPtr *));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
prop = prop->next;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
winMultiWindowGetWMName (WindowPtr pWin, char **wmName)
|
||||
|
|
|
|||
|
|
@ -110,4 +110,7 @@ winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints);
|
|||
int
|
||||
winMultiWindowGetWMName (WindowPtr pWin, char **wmName);
|
||||
|
||||
int
|
||||
winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ winUpdateWindowsWindow (WindowPtr pWin);
|
|||
static void
|
||||
winFindWindow (pointer value, XID id, pointer cdata);
|
||||
|
||||
|
||||
/*
|
||||
* Constant defines
|
||||
*/
|
||||
|
|
@ -478,12 +477,14 @@ winCreateWindowsWindow (WindowPtr pWin)
|
|||
/* Default positions if none specified */
|
||||
if (!winMultiWindowGetWMNormalHints(pWin, &hints))
|
||||
hints.flags = 0;
|
||||
if ( !(hints.flags & (USPosition|PPosition)) )
|
||||
if ( !(hints.flags & (USPosition|PPosition)) &&
|
||||
!winMultiWindowGetTransientFor (pWin, NULL) &&
|
||||
!pWin->overrideRedirect )
|
||||
{
|
||||
iX = CW_USEDEFAULT;
|
||||
iY = CW_USEDEFAULT;
|
||||
}
|
||||
|
||||
|
||||
iWidth = pWin->drawable.width;
|
||||
iHeight = pWin->drawable.height;
|
||||
|
||||
|
|
@ -907,3 +908,4 @@ winAdjustXWindow (WindowPtr pWin, HWND hwnd)
|
|||
#undef WIDTH
|
||||
#undef HEIGHT
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue