aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Screen.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
index 6ec4b245f..4e466b502 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c
@@ -297,6 +297,28 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo)
}
}
+/* check if possible_parent is parent of candidate */
+Bool nxagentIsParentOf(Display *d, Window possible_parent, Window candidate)
+{
+ Window parent, root, *children = NULL;
+ unsigned int num_children;
+
+ if (XQueryTree(d, candidate, &root, &parent, &children, &num_children))
+ {
+ if (children)
+ XFree((char *)children);
+
+ #ifdef TEST
+ fprintf(stderr, "%s: parent of full screen window [%p] root [%p] possible_parent [%p] candidate [%p]\n", __func__, parent, root, possible_parent, candidate);
+ #endif
+ return (parent == possible_parent);
+ }
+ else
+ {
+ return False;
+ }
+}
+
void nxagentMinimizeFromFullScreen(ScreenPtr pScreen)
{
XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow);