Skip to content

Commit

Permalink
AddWindow: don't vtash reparenting
Browse files Browse the repository at this point in the history
When identifying windows via XQueryTree(), ensure that both children and
nchildren are considered.

Fixes #785

Signed-off-by: Thomas Adam <thomas@fvwm.org>
  • Loading branch information
ThomasAdam committed Dec 25, 2022
1 parent ad8e4a0 commit 09d6b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fvwm/add_window.c
Expand Up @@ -2599,12 +2599,12 @@ FvwmWindow *AddWindow(
}
{
unsigned int nchildren;
Window parent, *children;
Window parent, *children = NULL;
Status rc;

rc = XQueryTree(
dpy, w, &JunkRoot, &parent, &children, &nchildren);
if (nchildren > 0)
if (nchildren > 0 && children != NULL)
{
XFree(children);
}
Expand Down

0 comments on commit 09d6b88

Please sign in to comment.