summaryrefslogtreecommitdiff
blob: 56f9e8ff53a1347a23e2f5d70f6a67212eaa082f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/xxkb.c
+++ b/xxkb.c
@@ -667,12 +667,14 @@
 					Window rwin, parent, *children;
 					int num;
 
-					XQueryTree(dpy, temp_win, &rwin, &parent, &children, &num);
-					AddWindow(temp_win, parent);
+					if (XQueryTree(dpy, temp_win, &rwin, &parent, &children, &num) != 0)
+                    {
+                        AddWindow(temp_win, parent);
 
-					if (children != None) {
-						XFree(children);
-					}
+                        if (children != None) {
+                            XFree(children);
+                        }
+                    }
 				}
 				break;