diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-06-26 18:50:44 +0200 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2019-06-27 20:21:57 +0200 |
commit | d32706888f83b91d6feab93067d1207c507335fa (patch) | |
tree | 4dd71ca8aa923c63258f9869d3e6c46e50296290 /nx-X11 | |
parent | c190fd1871d00168e2db6df9b91e8bc1ef69fbf5 (diff) | |
download | nx-libs-d32706888f83b91d6feab93067d1207c507335fa.tar.gz nx-libs-d32706888f83b91d6feab93067d1207c507335fa.tar.bz2 nx-libs-d32706888f83b91d6feab93067d1207c507335fa.zip |
Screen.c: add nxagentIsParentOf helper
Diffstat (limited to 'nx-X11')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Screen.c | 22 |
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); |