Mercurial > minori
comparison dep/animia/src/win/x11.cc @ 167:31735c8592bc
dep/animia: make x11 window walking actually work
this is HORRIBLY slow, and I'm not *entirely* sure why...
author | paper@DavesDouble.local |
---|---|
date | Sun, 19 Nov 2023 05:32:06 -0500 |
parents | 54c5d80a737e |
children | 0fc126d52de4 |
comparison
equal
deleted
inserted
replaced
166:54c5d80a737e | 167:31735c8592bc |
---|---|
102 | 102 |
103 ::Window root_return; | 103 ::Window root_return; |
104 ::Window parent_return; | 104 ::Window parent_return; |
105 | 105 |
106 int status = ::XQueryTree(display, window, &root_return, &parent_return, &children_arr, &num_children); | 106 int status = ::XQueryTree(display, window, &root_return, &parent_return, &children_arr, &num_children); |
107 if (status < Success) | 107 if (!status || !children_arr) |
108 continue; | 108 continue; |
109 | 109 |
110 if (num_children < 1) { | 110 if (num_children < 1) { |
111 ::XFree(children_arr); | 111 ::XFree(children_arr); |
112 continue; | 112 continue; |
118 | 118 |
119 ::XFree(children_arr); | 119 ::XFree(children_arr); |
120 | 120 |
121 std::set<::Window> children_children; | 121 std::set<::Window> children_children; |
122 | 122 |
123 if (!WalkWindows(display, children_children, children)) | 123 if (WalkWindows(display, children_children, children)) |
124 children.insert(children_children.begin(), children_children.end()); | 124 children.insert(children_children.begin(), children_children.end()); |
125 } | 125 } |
126 | 126 |
127 return true; | 127 return true; |
128 } | 128 } |