mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-06 10:58:26 +02:00
- Updated kintox11 binary to handle errors better in the get top window function
This commit is contained in:
Binary file not shown.
@@ -18,6 +18,7 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <X11/Xlib.h> // `apt-get install libx11-dev`
|
#include <X11/Xlib.h> // `apt-get install libx11-dev`
|
||||||
#include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev`
|
#include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev`
|
||||||
#include <json-c/json.h> // `apt install libjson-c-dev`
|
#include <json-c/json.h> // `apt install libjson-c-dev`
|
||||||
@@ -100,16 +101,15 @@ Window get_top_window(Display* d, Window start){
|
|||||||
unsigned int nchildren;
|
unsigned int nchildren;
|
||||||
Status s;
|
Status s;
|
||||||
|
|
||||||
// printf("getting top window ... \n");
|
while (parent != root && parent != 0) {
|
||||||
while (parent != root) {
|
|
||||||
w = parent;
|
w = parent;
|
||||||
s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man
|
s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
XFree(children);
|
XFree(children);
|
||||||
|
|
||||||
if(xerror || w == 0){
|
if(xerror){
|
||||||
printf("fail\n");
|
printf("fail to get top window: %d\n",w);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user