diff --git a/kintox11/binary/kintox11 b/kintox11/binary/kintox11 index 769ad7aa..f89146ff 100755 Binary files a/kintox11/binary/kintox11 and b/kintox11/binary/kintox11 differ diff --git a/kintox11/src/kintox11.c b/kintox11/src/kintox11.c index c1e0dd91..3895daec 100644 --- a/kintox11/src/kintox11.c +++ b/kintox11/src/kintox11.c @@ -18,6 +18,7 @@ #include #include #include +#include #include // `apt-get install libx11-dev` #include // `apt-get install libxmu-dev` #include // `apt install libjson-c-dev` @@ -100,16 +101,15 @@ Window get_top_window(Display* d, Window start){ unsigned int nchildren; Status s; - // printf("getting top window ... \n"); - while (parent != root) { + while (parent != root && parent != 0) { w = parent; s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man if (s) XFree(children); - if(xerror || w == 0){ - printf("fail\n"); + if(xerror){ + printf("fail to get top window: %d\n",w); exit(1); }