Mercurial > minori
annotate dep/animia/src/win/x11.cc @ 235:593108b3d555
dep/animia: x11: finalize xcb conversion
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 16 Jan 2024 15:22:29 -0500 |
parents | 8ccf0302afb1 |
children | 4d461ef7d424 |
rev | line source |
---|---|
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
1 /* |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
2 * win/x11.cc: provides support for X11 clients via XCB |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
3 * |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
4 * This code is fairly fast (I think...). As a result, |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
5 * a lot of it is hard to read if you're unfamiliar with |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
6 * asynchronous programming, but it works much better than |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
7 * Xlib (which can take much longer). |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
8 */ |
157 | 9 #include "animia/win/x11.h" |
10 #include "animia/win.h" | |
11 #include "animia.h" | |
12 | |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
13 #include <xcb/xcb.h> |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
14 #include <xcb/res.h> |
158
80d6b28eb29f
dep/animia: fix most X11 stuff
Paper <mrpapersonic@gmail.com>
parents:
157
diff
changeset
|
15 |
157 | 16 #include <cstdint> |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
17 #include <climits> |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
18 #include <cstring> |
157 | 19 #include <string> |
158
80d6b28eb29f
dep/animia: fix most X11 stuff
Paper <mrpapersonic@gmail.com>
parents:
157
diff
changeset
|
20 #include <set> |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
21 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
22 static size_t str_nlen(const char* s, size_t len) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
23 size_t i = 0; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
24 for (; i < len && s[i]; i++); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
25 return i; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
26 } |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
27 |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
28 namespace animia::internal::x11 { |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
29 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
30 static bool GetAllTopLevelWindowsEWMH(xcb_connection_t* connection, const std::vector<xcb_window_t>& roots, std::set<xcb_window_t>& result) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
31 const xcb_atom_t Atom__NET_CLIENT_LIST = [connection]{ |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
32 static constexpr std::string_view name = "_NET_CLIENT_LIST"; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
33 xcb_intern_atom_cookie_t cookie = ::xcb_intern_atom(connection, true, name.size(), name.data()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
34 xcb_intern_atom_reply_t* reply = ::xcb_intern_atom_reply(connection, cookie, NULL); |
166 | 35 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
36 xcb_atom_t atom = reply->atom; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
37 free(reply); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
38 return atom; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
39 }(); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
40 if (Atom__NET_CLIENT_LIST == XCB_ATOM_NONE) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
41 return false; // BTFO |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
42 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
43 bool success = false; |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
44 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
45 std::vector<xcb_get_property_cookie_t> cookies; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
46 cookies.reserve(roots.size()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
47 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
48 for (const auto& root : roots) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
49 cookies.push_back(::xcb_get_property(connection, 0, root, Atom__NET_CLIENT_LIST, XCB_ATOM_ANY, 0L, UINT_MAX)); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
50 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
51 for (const auto& cookie : cookies) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
52 xcb_get_property_reply_t* reply = ::xcb_get_property_reply(connection, cookie, NULL); |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
53 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
54 if (reply && reply->length == 32) { |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
55 xcb_window_t* value = reinterpret_cast<xcb_window_t*>(::xcb_get_property_value(reply)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
56 int len = ::xcb_get_property_value_length(reply); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
57 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
58 for (size_t i = 0; i < len; i++) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
59 result.insert(value[i]); |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
60 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
61 success = true; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
62 } |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
63 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
64 free(reply); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
65 } |
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
66 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
67 return success; |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
68 } |
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
69 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
70 static bool WalkWindows(xcb_connection_t* connection, const std::vector<xcb_window_t>& roots, std::set<xcb_window_t>& result) { |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
71 /* move this somewhere else pl0x */ |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
72 xcb_atom_t Atom_WM_STATE = [connection]{ |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
73 static constexpr std::string_view name = "WM_STATE"; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
74 xcb_intern_atom_cookie_t cookie = ::xcb_intern_atom(connection, true, name.size(), name.data()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
75 xcb_intern_atom_reply_t* reply = ::xcb_intern_atom_reply(connection, cookie, NULL); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
76 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
77 xcb_atom_t atom = reply->atom; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
78 free(reply); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
79 return atom; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
80 }(); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
81 if (Atom_WM_STATE == XCB_ATOM_NONE) |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
82 return false; |
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
83 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
84 /* for each toplevel: search recursively for */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
85 std::function<bool(const xcb_window_t*, const int, xcb_window_t&)> find_wm_state_window = [&](const xcb_window_t* wins, const int wins_len, xcb_window_t& out) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
86 /* Check for wm_state */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
87 { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
88 std::vector<xcb_get_property_cookie_t> property_cookies; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
89 property_cookies.reserve(wins_len); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
90 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
91 for (size_t j = 0; j < wins_len; j++) |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
92 property_cookies.push_back(::xcb_get_property(connection, 0, wins[j], Atom_WM_STATE, Atom_WM_STATE, 0, 0)); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
93 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
94 for (size_t j = 0; j < property_cookies.size(); j++) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
95 xcb_generic_error_t* err = NULL; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
96 xcb_get_property_reply_t* reply = ::xcb_get_property_reply(connection, property_cookies.at(j), &err); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
97 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
98 if (reply->format || reply->type || reply->length) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
99 out = wins[j]; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
100 free(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
101 return true; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
102 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
103 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
104 free(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
105 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
106 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
107 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
108 /* Query tree for recursion */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
109 { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
110 std::vector<xcb_query_tree_cookie_t> cookies; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
111 cookies.reserve(wins_len); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
112 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
113 for (size_t j = 0; j < wins_len; j++) |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
114 cookies.push_back(::xcb_query_tree(connection, wins[j])); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
115 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
116 for (const auto& cookie : cookies) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
117 xcb_query_tree_reply_t* reply = ::xcb_query_tree_reply(connection, cookie, NULL); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
118 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
119 xcb_window_t* windows = ::xcb_query_tree_children(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
120 int len = ::xcb_query_tree_children_length(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
121 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
122 if (find_wm_state_window(windows, len, out)) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
123 free(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
124 return true; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
125 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
126 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
127 free(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
128 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
129 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
130 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
131 return false; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
132 }; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
133 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
134 /* Get the tree for each root */ |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
135 std::vector<xcb_query_tree_cookie_t> cookies; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
136 cookies.reserve(roots.size()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
137 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
138 for (const auto& root : roots) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
139 cookies.push_back(::xcb_query_tree(connection, root)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
140 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
141 for (size_t i = 0; i < cookies.size(); i++) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
142 xcb_query_tree_reply_t* reply = ::xcb_query_tree_reply(connection, cookies.at(i), NULL); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
143 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
144 xcb_window_t* windows = ::xcb_query_tree_children(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
145 int len = ::xcb_query_tree_children_length(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
146 if (len < 1) |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
147 continue; |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
148 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
149 /* Then get the tree of each child window. */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
150 std::vector<xcb_query_tree_cookie_t> cookies; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
151 cookies.reserve(len); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
152 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
153 for (size_t j = 0; j < len; j++) |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
154 cookies.push_back(::xcb_query_tree(connection, windows[j])); |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
155 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
156 /* For each child window... */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
157 for (size_t j = 0; j < cookies.size(); j++) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
158 xcb_query_tree_reply_t* reply = ::xcb_query_tree_reply(connection, cookies.at(j), NULL); |
166 | 159 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
160 xcb_window_t* children = ::xcb_query_tree_children(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
161 int children_len = ::xcb_query_tree_children_length(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
162 if (children_len < 1) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
163 result.insert(windows[j]); |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
164 continue; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
165 } |
166 | 166 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
167 xcb_window_t out = windows[j]; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
168 /* Search recursively for a window with WM_STATE. If we don't, |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
169 * just add the toplevel. |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
170 */ |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
171 find_wm_state_window(children, children_len, out); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
172 result.insert(out); |
213
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
173 } |
58e81b42a0d6
dep/animia: win/x11: find toplevels WAY faster
Paper <mrpapersonic@gmail.com>
parents:
199
diff
changeset
|
174 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
175 free(reply); |
166 | 176 } |
177 | |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
178 return false; |
166 | 179 } |
180 | |
198
bc1ae1810855
dep/animia: switch from using classes to global functions
Paper <mrpapersonic@gmail.com>
parents:
191
diff
changeset
|
181 bool EnumerateWindows(window_proc_t window_proc) { |
158
80d6b28eb29f
dep/animia: fix most X11 stuff
Paper <mrpapersonic@gmail.com>
parents:
157
diff
changeset
|
182 if (!window_proc) |
80d6b28eb29f
dep/animia: fix most X11 stuff
Paper <mrpapersonic@gmail.com>
parents:
157
diff
changeset
|
183 return false; |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
184 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
185 xcb_connection_t* connection = ::xcb_connect(NULL, NULL); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
186 if (!connection) |
166 | 187 return false; |
188 | |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
189 std::vector<xcb_screen_t> screens; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
190 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
191 { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
192 xcb_screen_iterator_t iter = ::xcb_setup_roots_iterator(xcb_get_setup(connection)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
193 for (; iter.rem; ::xcb_screen_next(&iter)) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
194 screens.push_back(*iter.data); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
195 } |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
196 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
197 std::vector<xcb_window_t> roots; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
198 roots.reserve(screens.size()); |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
199 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
200 for (const auto& screen : screens) |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
201 roots.push_back(screen.root); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
202 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
203 std::set<xcb_window_t> windows; |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
204 if (!GetAllTopLevelWindowsEWMH(connection, roots, windows)) |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
205 WalkWindows(connection, roots, windows); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
206 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
207 std::vector<xcb_get_property_cookie_t> class_property_cookies; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
208 std::vector<xcb_get_property_cookie_t> name_property_cookies; |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
209 std::vector<xcb_res_query_client_ids_cookie_t> pid_property_cookies; |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
210 class_property_cookies.reserve(windows.size()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
211 name_property_cookies.reserve(windows.size()); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
212 pid_property_cookies.reserve(windows.size()); |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
213 |
166 | 214 for (const auto& window : windows) { |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
215 class_property_cookies.push_back(::xcb_get_property(connection, 0, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0L, 2048L)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
216 name_property_cookies.push_back(::xcb_get_property(connection, 0, window, XCB_ATOM_WM_NAME, XCB_ATOM_STRING, 0L, UINT_MAX)); |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
217 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
218 xcb_res_client_id_spec_t spec = { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
219 .client = window, |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
220 .mask = XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
221 }; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
222 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
223 pid_property_cookies.push_back(::xcb_res_query_client_ids(connection, 1, &spec)); |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
224 } |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
225 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
226 size_t i = 0; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
227 for (const auto& window : windows) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
228 Window win = {0}; |
158
80d6b28eb29f
dep/animia: fix most X11 stuff
Paper <mrpapersonic@gmail.com>
parents:
157
diff
changeset
|
229 win.id = window; |
157 | 230 { |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
231 xcb_get_property_reply_t* reply = ::xcb_get_property_reply(connection, class_property_cookies.at(i), NULL); |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
232 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
233 if (reply && reply->format == 8) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
234 const char* data = reinterpret_cast<char*>(::xcb_get_property_value(reply)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
235 const int data_len = ::xcb_get_property_value_length(reply); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
236 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
237 int instance_len = str_nlen(data, data_len); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
238 const char* class_name = data + instance_len + 1; |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
239 |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
240 win.class_name = std::string(class_name, str_nlen(class_name, data_len - (instance_len + 1))); |
157 | 241 } |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
242 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
243 free(reply); |
157 | 244 } |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
245 { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
246 xcb_get_property_reply_t* reply = ::xcb_get_property_reply(connection, name_property_cookies.at(i), NULL); |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
247 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
248 if (reply && reply->format == 8) { |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
249 const char* data = reinterpret_cast<char*>(::xcb_get_property_value(reply)); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
250 int len = ::xcb_get_property_value_length(reply); |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
251 |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
252 win.text = std::string(data, len); |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
253 } |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
254 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
255 free(reply); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
256 } |
235
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
257 Process proc = {0}; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
258 { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
259 xcb_res_query_client_ids_reply_t* reply = ::xcb_res_query_client_ids_reply(connection, pid_property_cookies.at(i), NULL); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
260 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
261 if (reply->length) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
262 xcb_res_client_id_value_iterator_t it = ::xcb_res_query_client_ids_ids_iterator(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
263 for (; it.rem; ::xcb_res_client_id_value_next(&it)) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
264 if (it.data->spec.mask & XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID) { |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
265 proc.pid = *::xcb_res_client_id_value_value(it.data); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
266 break; |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
267 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
268 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
269 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
270 |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
271 free(reply); |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
272 } |
593108b3d555
dep/animia: x11: finalize xcb conversion
Paper <paper@paper.us.eu.org>
parents:
234
diff
changeset
|
273 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
274 if (!window_proc(proc, win)) { |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
275 ::xcb_disconnect(connection); |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
276 return false; |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
277 } |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
278 i++; |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
279 } |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
280 |
234
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
281 ::xcb_disconnect(connection); |
8ccf0302afb1
dep/animia: convert xlib code to xcb
Paper <mrpapersonic@gmail.com>
parents:
214
diff
changeset
|
282 |
156
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
283 return true; |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
284 } |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
285 |
cdf79282d647
dep/animia: add VERY early x11 window stuff
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
286 } |