diff options
author | Earle F. Philhower III <earle@ziplabel.com> | 2004-03-18 16:17:57 +0000 |
---|---|---|
committer | Earle F. Philhower III <earle@ziplabel.com> | 2004-03-18 16:17:57 +0000 |
commit | 559610b8a29e2df5a1da459ce174ebaf3643266c (patch) | |
tree | c489c2693dc7050c9558f4339164c6efe7f62e00 | |
parent | 78cc1a5768ce7636f599fc168654f54cc3361648 (diff) |
Fix window cascading to not affect popups or menus
-rwxr-xr-x | hw/xwin/winmultiwindowclass.c | 38 | ||||
-rwxr-xr-x | hw/xwin/winmultiwindowclass.h | 3 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 8 |
3 files changed, 45 insertions, 4 deletions
diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c index 2f77e719e..d369db70e 100755 --- a/hw/xwin/winmultiwindowclass.c +++ b/hw/xwin/winmultiwindowclass.c @@ -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) diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h index 1bca0e4e8..0b430f2f8 100755 --- a/hw/xwin/winmultiwindowclass.h +++ b/hw/xwin/winmultiwindowclass.h @@ -110,4 +110,7 @@ winMultiWindowGetWMNormalHints (WindowPtr pWin, WinXSizeHints *hints); int winMultiWindowGetWMName (WindowPtr pWin, char **wmName); +int +winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy); + #endif diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index ca80f3576..ed2215e9f 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -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 } + |