From c9f6b65c19e3e8ebd1bd4ca860a0e1fd66931e65 Mon Sep 17 00:00:00 2001
From: Arnaud Fontaine <arnau@debian.org>
Date: Wed, 27 Apr 2011 15:44:35 +0900
Subject: [PATCH 1/1] Update the code following release of xcb-util 0.3.8.
xcb-util is now split into several repositories since 0.3.8. This
release also cleaned up the API a lot, thus update the code
accordingly.
Signed-off-by: Arnaud Fontaine <arnau@debian.org>
Signed-off-by: Uli Schlachter <psychon@znc.in>
---
awesome.c | 2 +-
awesomeConfig.cmake | 7 ++---
client.c | 56 +++++++++++++++++++++---------------------
client.h | 6 ++--
common/xutil.c | 1 -
event.c | 10 +++---
ewmh.c | 4 +-
property.c | 68 +++++++++++++++++++++++++-------------------------
selection.c | 14 +++++-----
systray.c | 2 +-
window.c | 4 +-
11 files changed, 86 insertions(+), 88 deletions(-)
diff --git a/awesome.c b/awesome.c
index f89080c..1258b4c 100644
a
|
b
|
scan(void) |
154 | 154 | |
155 | 155 | if(!attr_r || attr_r->override_redirect |
156 | 156 | || attr_r->map_state == XCB_MAP_STATE_UNMAPPED |
157 | | || state == XCB_WM_STATE_WITHDRAWN) |
| 157 | || state == XCB_ICCCM_WM_STATE_WITHDRAWN) |
158 | 158 | { |
159 | 159 | geom_wins[i] = NULL; |
160 | 160 | p_delete(&attr_r); |
diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake
index ee75d49..252110a 100644
a
|
b
|
execute_process( |
127 | 127 | |
128 | 128 | # Use pkgconfig to get most of the libraries |
129 | 129 | pkg_check_modules(AWESOME_COMMON_REQUIRED REQUIRED |
130 | | xcb>=1.4) |
| 130 | xcb>=1.6) |
131 | 131 | |
132 | 132 | pkg_check_modules(AWESOME_REQUIRED REQUIRED |
133 | 133 | glib-2.0 |
… |
… |
pkg_check_modules(AWESOME_REQUIRED REQUIRED |
139 | 139 | xcb-xtest |
140 | 140 | xcb-xinerama |
141 | 141 | xcb-shape |
142 | | xcb-aux>=0.3.0 |
143 | | xcb-atom>=0.3.0 |
| 142 | xcb-util>=0.3.8 |
144 | 143 | xcb-keysyms>=0.3.4 |
145 | | xcb-icccm>=0.3.6 |
| 144 | xcb-icccm>=0.3.8 |
146 | 145 | xcb-image>=0.3.0 |
147 | 146 | cairo-xcb |
148 | 147 | libstartup-notification-1.0>=0.10 |
diff --git a/client.c b/client.c
index 049e3d5..baae69f 100644
a
|
b
|
luaA_client_gc(lua_State *L) |
52 | 52 | client_t *c = luaA_checkudata(L, 1, &client_class); |
53 | 53 | button_array_wipe(&c->buttons); |
54 | 54 | key_array_wipe(&c->keys); |
55 | | xcb_get_wm_protocols_reply_wipe(&c->protocols); |
| 55 | xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols); |
56 | 56 | p_delete(&c->machine); |
57 | 57 | p_delete(&c->class); |
58 | 58 | p_delete(&c->instance); |
… |
… |
client_set_urgent(lua_State *L, int cidx, bool urgent) |
94 | 94 | if(c->urgent != urgent) |
95 | 95 | { |
96 | 96 | xcb_get_property_cookie_t hints = |
97 | | xcb_get_wm_hints_unchecked(globalconf.connection, c->window); |
| 97 | xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window); |
98 | 98 | |
99 | 99 | c->urgent = urgent; |
100 | 100 | ewmh_client_update_hints(c); |
101 | 101 | |
102 | 102 | /* update ICCCM hints */ |
103 | | xcb_wm_hints_t wmh; |
104 | | xcb_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL); |
| 103 | xcb_icccm_wm_hints_t wmh; |
| 104 | xcb_icccm_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL); |
105 | 105 | |
106 | 106 | if(urgent) |
107 | | wmh.flags |= XCB_WM_HINT_X_URGENCY; |
| 107 | wmh.flags |= XCB_ICCCM_WM_HINT_X_URGENCY; |
108 | 108 | else |
109 | | wmh.flags &= ~XCB_WM_HINT_X_URGENCY; |
| 109 | wmh.flags &= ~XCB_ICCCM_WM_HINT_X_URGENCY; |
110 | 110 | |
111 | | xcb_set_wm_hints(globalconf.connection, c->window, &wmh); |
| 111 | xcb_icccm_set_wm_hints(globalconf.connection, c->window, &wmh); |
112 | 112 | |
113 | 113 | hook_property(c, "urgent"); |
114 | 114 | luaA_object_emit_signal(L, cidx, "property::urgent", 0); |
… |
… |
HANDLE_GEOM(height) |
721 | 721 | * |
722 | 722 | * At this stage it's just safer to keep it in normal state and avoid confusion. |
723 | 723 | */ |
724 | | window_state_set(c->window, XCB_WM_STATE_NORMAL); |
| 724 | window_state_set(c->window, XCB_ICCCM_WM_STATE_NORMAL); |
725 | 725 | |
726 | 726 | if(!startup) |
727 | 727 | { |
… |
… |
client_geometry_hints(client_t *c, area_t geometry) |
767 | 767 | int32_t real_basew = 0, real_baseh = 0; |
768 | 768 | |
769 | 769 | /* base size is substituted with min size if not specified */ |
770 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) |
| 770 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) |
771 | 771 | { |
772 | 772 | basew = c->size_hints.base_width; |
773 | 773 | baseh = c->size_hints.base_height; |
774 | 774 | real_basew = basew; |
775 | 775 | real_baseh = baseh; |
776 | 776 | } |
777 | | else if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) |
| 777 | else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) |
778 | 778 | { |
779 | 779 | basew = c->size_hints.min_width; |
780 | 780 | baseh = c->size_hints.min_height; |
… |
… |
client_geometry_hints(client_t *c, area_t geometry) |
783 | 783 | basew = baseh = 0; |
784 | 784 | |
785 | 785 | /* min size is substituted with base size if not specified */ |
786 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) |
| 786 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) |
787 | 787 | { |
788 | 788 | minw = c->size_hints.min_width; |
789 | 789 | minh = c->size_hints.min_height; |
790 | 790 | } |
791 | | else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) |
| 791 | else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) |
792 | 792 | { |
793 | 793 | minw = c->size_hints.base_width; |
794 | 794 | minh = c->size_hints.base_height; |
… |
… |
client_geometry_hints(client_t *c, area_t geometry) |
796 | 796 | else |
797 | 797 | minw = minh = 0; |
798 | 798 | |
799 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT |
| 799 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT |
800 | 800 | && c->size_hints.min_aspect_den > 0 |
801 | 801 | && c->size_hints.max_aspect_den > 0 |
802 | 802 | && geometry.height - real_baseh > 0 |
… |
… |
client_geometry_hints(client_t *c, area_t geometry) |
838 | 838 | if(minh) |
839 | 839 | geometry.height = MAX(geometry.height, minh); |
840 | 840 | |
841 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE) |
| 841 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) |
842 | 842 | { |
843 | 843 | if(c->size_hints.max_width) |
844 | 844 | geometry.width = MIN(geometry.width, c->size_hints.max_width); |
… |
… |
client_geometry_hints(client_t *c, area_t geometry) |
846 | 846 | geometry.height = MIN(geometry.height, c->size_hints.max_height); |
847 | 847 | } |
848 | 848 | |
849 | | if(c->size_hints.flags & (XCB_SIZE_HINT_P_RESIZE_INC | XCB_SIZE_HINT_BASE_SIZE) |
| 849 | if(c->size_hints.flags & (XCB_ICCCM_SIZE_HINT_P_RESIZE_INC | XCB_ICCCM_SIZE_HINT_BASE_SIZE) |
850 | 850 | && c->size_hints.width_inc && c->size_hints.height_inc) |
851 | 851 | { |
852 | 852 | uint16_t t1 = geometry.width, t2 = geometry.height; |
… |
… |
client_set_minimized(lua_State *L, int cidx, bool s) |
969 | 969 | c->minimized = s; |
970 | 970 | banning_need_update((c)->screen); |
971 | 971 | if(s) |
972 | | window_state_set(c->window, XCB_WM_STATE_ICONIC); |
| 972 | window_state_set(c->window, XCB_ICCCM_WM_STATE_ICONIC); |
973 | 973 | else |
974 | | window_state_set(c->window, XCB_WM_STATE_NORMAL); |
| 974 | window_state_set(c->window, XCB_ICCCM_WM_STATE_NORMAL); |
975 | 975 | ewmh_client_update_hints(c); |
976 | 976 | if(strut_has_value(&c->strut)) |
977 | 977 | screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0); |
… |
… |
client_unmanage(client_t *c) |
1333 | 1333 | |
1334 | 1334 | /* Do this last to avoid races with clients. According to ICCCM, clients |
1335 | 1335 | * arent allowed to re-use the window until after this. */ |
1336 | | window_state_set(c->window, XCB_WM_STATE_WITHDRAWN); |
| 1336 | window_state_set(c->window, XCB_ICCCM_WM_STATE_WITHDRAWN); |
1337 | 1337 | |
1338 | 1338 | /* set client as invalid */ |
1339 | 1339 | c->invalid = true; |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2052 | 2052 | |
2053 | 2053 | lua_createtable(L, 0, 1); |
2054 | 2054 | |
2055 | | if(c->size_hints.flags & XCB_SIZE_HINT_US_POSITION) |
| 2055 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION) |
2056 | 2056 | u_or_p = "user_position"; |
2057 | | else if(c->size_hints.flags & XCB_SIZE_HINT_P_POSITION) |
| 2057 | else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION) |
2058 | 2058 | u_or_p = "program_position"; |
2059 | 2059 | |
2060 | 2060 | if(u_or_p) |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2068 | 2068 | u_or_p = NULL; |
2069 | 2069 | } |
2070 | 2070 | |
2071 | | if(c->size_hints.flags & XCB_SIZE_HINT_US_SIZE) |
| 2071 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE) |
2072 | 2072 | u_or_p = "user_size"; |
2073 | | else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) |
| 2073 | else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) |
2074 | 2074 | u_or_p = "program_size"; |
2075 | 2075 | |
2076 | 2076 | if(u_or_p) |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2083 | 2083 | lua_setfield(L, -2, u_or_p); |
2084 | 2084 | } |
2085 | 2085 | |
2086 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) |
| 2086 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) |
2087 | 2087 | { |
2088 | 2088 | lua_pushnumber(L, c->size_hints.min_width); |
2089 | 2089 | lua_setfield(L, -2, "min_width"); |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2091 | 2091 | lua_setfield(L, -2, "min_height"); |
2092 | 2092 | } |
2093 | 2093 | |
2094 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE) |
| 2094 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) |
2095 | 2095 | { |
2096 | 2096 | lua_pushnumber(L, c->size_hints.max_width); |
2097 | 2097 | lua_setfield(L, -2, "max_width"); |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2099 | 2099 | lua_setfield(L, -2, "max_height"); |
2100 | 2100 | } |
2101 | 2101 | |
2102 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_RESIZE_INC) |
| 2102 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC) |
2103 | 2103 | { |
2104 | 2104 | lua_pushnumber(L, c->size_hints.width_inc); |
2105 | 2105 | lua_setfield(L, -2, "width_inc"); |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2107 | 2107 | lua_setfield(L, -2, "height_inc"); |
2108 | 2108 | } |
2109 | 2109 | |
2110 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT) |
| 2110 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT) |
2111 | 2111 | { |
2112 | 2112 | lua_pushnumber(L, c->size_hints.min_aspect_num); |
2113 | 2113 | lua_setfield(L, -2, "min_aspect_num"); |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2119 | 2119 | lua_setfield(L, -2, "max_aspect_den"); |
2120 | 2120 | } |
2121 | 2121 | |
2122 | | if(c->size_hints.flags & XCB_SIZE_HINT_BASE_SIZE) |
| 2122 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) |
2123 | 2123 | { |
2124 | 2124 | lua_pushnumber(L, c->size_hints.base_width); |
2125 | 2125 | lua_setfield(L, -2, "base_width"); |
… |
… |
luaA_client_get_size_hints(lua_State *L, client_t *c) |
2127 | 2127 | lua_setfield(L, -2, "base_height"); |
2128 | 2128 | } |
2129 | 2129 | |
2130 | | if(c->size_hints.flags & XCB_SIZE_HINT_P_WIN_GRAVITY) |
| 2130 | if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY) |
2131 | 2131 | { |
2132 | 2132 | switch(c->size_hints.win_gravity) |
2133 | 2133 | { |
diff --git a/client.h b/client.h
index d4ef52f..9674fac 100644
a
|
b
|
struct client_t |
123 | 123 | /** Window holding command needed to start it (session management related) */ |
124 | 124 | xcb_window_t leader_window; |
125 | 125 | /** Client's WM_PROTOCOLS property */ |
126 | | xcb_get_wm_protocols_reply_t protocols; |
| 126 | xcb_icccm_get_wm_protocols_reply_t protocols; |
127 | 127 | /** Client logical screen */ |
128 | 128 | screen_t *screen; |
129 | 129 | /** Client physical screen */ |
… |
… |
client_raise(client_t *c) |
248 | 248 | static inline bool |
249 | 249 | client_isfixed(client_t *c) |
250 | 250 | { |
251 | | return (c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE |
252 | | && c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE |
| 251 | return (c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE |
| 252 | && c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE |
253 | 253 | && c->size_hints.max_width == c->size_hints.min_width |
254 | 254 | && c->size_hints.max_height == c->size_hints.min_height |
255 | 255 | && c->size_hints.max_width |
diff --git a/common/xutil.c b/common/xutil.c
index 3d80e8d..c5a2127 100644
a
|
b
|
|
25 | 25 | #include "common/util.h" |
26 | 26 | |
27 | 27 | #include <xcb/xcb.h> |
28 | | #include <xcb/xcb_atom.h> |
29 | 28 | #include <xcb/xcb_icccm.h> |
30 | 29 | |
31 | 30 | #include "common/xutil.h" |
diff --git a/event.c b/event.c
index 8527ec5..a35918b 100644
a
|
b
|
event_handle_clientmessage(xcb_client_message_event_t *ev) |
721 | 721 | client_t *c; |
722 | 722 | if((c = client_getbywin(ev->window)) |
723 | 723 | && ev->format == 32 |
724 | | && ev->data.data32[0] == XCB_WM_STATE_ICONIC) |
| 724 | && ev->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) |
725 | 725 | { |
726 | 726 | luaA_object_push(globalconf.L, c); |
727 | 727 | client_set_minimized(globalconf.L, -1, true); |
… |
… |
static void |
795 | 795 | xerror(xcb_generic_error_t *e) |
796 | 796 | { |
797 | 797 | /* ignore this */ |
798 | | if(e->error_code == XCB_EVENT_ERROR_BAD_WINDOW |
799 | | || (e->error_code == XCB_EVENT_ERROR_BAD_MATCH |
| 798 | if(e->error_code == XCB_WINDOW |
| 799 | || (e->error_code == XCB_MATCH |
800 | 800 | && e->major_code == XCB_SET_INPUT_FOCUS) |
801 | | || (e->error_code == XCB_EVENT_ERROR_BAD_VALUE |
| 801 | || (e->error_code == XCB_VALUE |
802 | 802 | && e->major_code == XCB_KILL_CLIENT) |
803 | 803 | || (e->major_code == XCB_CONFIGURE_WINDOW |
804 | | && e->error_code == XCB_EVENT_ERROR_BAD_MATCH)) |
| 804 | && e->error_code == XCB_MATCH)) |
805 | 805 | return; |
806 | 806 | |
807 | 807 | warn("X error: request=%s, error=%s", |
diff --git a/ewmh.c b/ewmh.c
index 0aa5de7..ba4776c 100644
a
|
b
|
ewmh_update_net_active_window(int phys_screen) |
226 | 226 | |
227 | 227 | xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, |
228 | 228 | xutil_screen_get(globalconf.connection, phys_screen)->root, |
229 | | _NET_ACTIVE_WINDOW, WINDOW, 32, 1, &win); |
| 229 | _NET_ACTIVE_WINDOW, XCB_ATOM_WINDOW, 32, 1, &win); |
230 | 230 | } |
231 | 231 | |
232 | 232 | static void |
… |
… |
ewmh_client_update_hints(client_t *c) |
425 | 425 | state[i++] = _NET_WM_STATE_DEMANDS_ATTENTION; |
426 | 426 | |
427 | 427 | xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, |
428 | | c->window, _NET_WM_STATE, ATOM, 32, i, state); |
| 428 | c->window, _NET_WM_STATE, XCB_ATOM_ATOM, 32, i, state); |
429 | 429 | } |
430 | 430 | |
431 | 431 | /** Update the client active desktop. |
diff --git a/property.c b/property.c
index d5090c6..d2223ef 100644
a
|
b
|
property_update_wm_transient_for(client_t *c, xcb_get_property_reply_t *reply) |
105 | 105 | |
106 | 106 | if(reply) |
107 | 107 | { |
108 | | if(!xcb_get_wm_transient_for_from_reply(&trans, reply)) |
| 108 | if(!xcb_icccm_get_wm_transient_for_from_reply(&trans, reply)) |
109 | 109 | return; |
110 | 110 | } |
111 | 111 | else |
112 | 112 | { |
113 | | if(!xcb_get_wm_transient_for_reply(globalconf.connection, |
114 | | xcb_get_wm_transient_for_unchecked(globalconf.connection, |
115 | | c->window), |
| 113 | if(!xcb_icccm_get_wm_transient_for_reply(globalconf.connection, |
| 114 | xcb_icccm_get_wm_transient_for_unchecked(globalconf.connection, |
| 115 | c->window), |
116 | 116 | &trans, NULL)) |
117 | 117 | return; |
118 | 118 | } |
… |
… |
property_update_wm_normal_hints(client_t *c, xcb_get_property_reply_t *reply) |
160 | 160 | { |
161 | 161 | if(reply) |
162 | 162 | { |
163 | | if(!xcb_get_wm_size_hints_from_reply(&c->size_hints, reply)) |
| 163 | if(!xcb_icccm_get_wm_size_hints_from_reply(&c->size_hints, reply)) |
164 | 164 | return; |
165 | 165 | } |
166 | 166 | else |
167 | 167 | { |
168 | | if(!xcb_get_wm_normal_hints_reply(globalconf.connection, |
169 | | xcb_get_wm_normal_hints_unchecked(globalconf.connection, |
170 | | c->window), |
171 | | &c->size_hints, NULL)) |
| 168 | if(!xcb_icccm_get_wm_normal_hints_reply(globalconf.connection, |
| 169 | xcb_icccm_get_wm_normal_hints_unchecked(globalconf.connection, |
| 170 | c->window), |
| 171 | &c->size_hints, NULL)) |
172 | 172 | return; |
173 | 173 | } |
174 | 174 | } |
… |
… |
property_update_wm_normal_hints(client_t *c, xcb_get_property_reply_t *reply) |
180 | 180 | void |
181 | 181 | property_update_wm_hints(client_t *c, xcb_get_property_reply_t *reply) |
182 | 182 | { |
183 | | xcb_wm_hints_t wmh; |
| 183 | xcb_icccm_wm_hints_t wmh; |
184 | 184 | |
185 | 185 | if(reply) |
186 | 186 | { |
187 | | if(!xcb_get_wm_hints_from_reply(&wmh, reply)) |
| 187 | if(!xcb_icccm_get_wm_hints_from_reply(&wmh, reply)) |
188 | 188 | return; |
189 | 189 | } |
190 | 190 | else |
191 | 191 | { |
192 | | if(!xcb_get_wm_hints_reply(globalconf.connection, |
193 | | xcb_get_wm_hints_unchecked(globalconf.connection, c->window), |
194 | | &wmh, NULL)) |
| 192 | if(!xcb_icccm_get_wm_hints_reply(globalconf.connection, |
| 193 | xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window), |
| 194 | &wmh, NULL)) |
195 | 195 | return; |
196 | 196 | } |
197 | 197 | |
198 | 198 | luaA_object_push(globalconf.L, c); |
199 | | client_set_urgent(globalconf.L, -1, xcb_wm_hints_get_urgency(&wmh)); |
200 | | if(wmh.flags & XCB_WM_HINT_STATE && |
201 | | wmh.initial_state == XCB_WM_STATE_WITHDRAWN) |
| 199 | client_set_urgent(globalconf.L, -1, xcb_icccm_wm_hints_get_urgency(&wmh)); |
| 200 | if(wmh.flags & XCB_ICCCM_WM_HINT_STATE && |
| 201 | wmh.initial_state == XCB_ICCCM_WM_STATE_WITHDRAWN) |
202 | 202 | client_set_border_width(globalconf.L, -1, 0); |
203 | 203 | |
204 | | if(wmh.flags & XCB_WM_HINT_INPUT) |
| 204 | if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT) |
205 | 205 | c->nofocus = !wmh.input; |
206 | 206 | |
207 | | if(wmh.flags & XCB_WM_HINT_WINDOW_GROUP) |
| 207 | if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP) |
208 | 208 | client_set_group_window(globalconf.L, -1, wmh.window_group); |
209 | 209 | |
210 | 210 | lua_pop(globalconf.L, 1); |
… |
… |
property_update_wm_hints(client_t *c, xcb_get_property_reply_t *reply) |
217 | 217 | void |
218 | 218 | property_update_wm_class(client_t *c, xcb_get_property_reply_t *reply) |
219 | 219 | { |
220 | | xcb_get_wm_class_reply_t hint; |
| 220 | xcb_icccm_get_wm_class_reply_t hint; |
221 | 221 | |
222 | 222 | if(reply) |
223 | 223 | { |
224 | | if(!xcb_get_wm_class_from_reply(&hint, reply)) |
| 224 | if(!xcb_icccm_get_wm_class_from_reply(&hint, reply)) |
225 | 225 | return; |
226 | 226 | } |
227 | 227 | else |
228 | 228 | { |
229 | | if(!xcb_get_wm_class_reply(globalconf.connection, |
230 | | xcb_get_wm_class_unchecked(globalconf.connection, c->window), |
231 | | &hint, NULL)) |
| 229 | if(!xcb_icccm_get_wm_class_reply(globalconf.connection, |
| 230 | xcb_icccm_get_wm_class_unchecked(globalconf.connection, c->window), |
| 231 | &hint, NULL)) |
232 | 232 | return; |
233 | 233 | } |
234 | 234 | |
… |
… |
property_update_wm_class(client_t *c, xcb_get_property_reply_t *reply) |
238 | 238 | |
239 | 239 | /* only delete reply if we get it ourselves */ |
240 | 240 | if(!reply) |
241 | | xcb_get_wm_class_reply_wipe(&hint); |
| 241 | xcb_icccm_get_wm_class_reply_wipe(&hint); |
242 | 242 | } |
243 | 243 | |
244 | 244 | static int |
… |
… |
property_update_net_wm_pid(client_t *c, |
308 | 308 | void |
309 | 309 | property_update_wm_protocols(client_t *c, xcb_get_property_reply_t *reply) |
310 | 310 | { |
311 | | xcb_get_wm_protocols_reply_t protocols; |
| 311 | xcb_icccm_get_wm_protocols_reply_t protocols; |
312 | 312 | xcb_get_property_reply_t *reply_copy; |
313 | 313 | |
314 | 314 | if(reply) |
315 | 315 | { |
316 | 316 | reply_copy = p_dup(reply, 1); |
317 | 317 | |
318 | | if(!xcb_get_wm_protocols_from_reply(reply_copy, &protocols)) |
319 | | { |
| 318 | if(!xcb_icccm_get_wm_protocols_from_reply(reply_copy, &protocols)) |
| 319 | { |
320 | 320 | p_delete(&reply_copy); |
321 | 321 | return; |
322 | | } |
| 322 | } |
323 | 323 | } |
324 | 324 | else |
325 | 325 | { |
326 | 326 | /* If this fails for any reason, we still got the old value */ |
327 | | if(!xcb_get_wm_protocols_reply(globalconf.connection, |
328 | | xcb_get_wm_protocols_unchecked(globalconf.connection, |
329 | | c->window, WM_PROTOCOLS), |
330 | | &protocols, NULL)) |
| 327 | if(!xcb_icccm_get_wm_protocols_reply(globalconf.connection, |
| 328 | xcb_icccm_get_wm_protocols_unchecked(globalconf.connection, |
| 329 | c->window, WM_PROTOCOLS), |
| 330 | &protocols, NULL)) |
331 | 331 | return; |
332 | 332 | } |
333 | 333 | |
334 | | xcb_get_wm_protocols_reply_wipe(&c->protocols); |
| 334 | xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols); |
335 | 335 | memcpy(&c->protocols, &protocols, sizeof(protocols)); |
336 | 336 | } |
337 | 337 | |
diff --git a/selection.c b/selection.c
index 527ec40..44b57c5 100644
a
|
b
|
luaA_selection_get(lua_State *L) |
86 | 86 | if(event_notify->selection == XCB_ATOM_PRIMARY |
87 | 87 | && event_notify->property != XCB_NONE) |
88 | 88 | { |
89 | | xcb_get_text_property_reply_t prop; |
| 89 | xcb_icccm_get_text_property_reply_t prop; |
90 | 90 | xcb_get_property_cookie_t cookie = |
91 | | xcb_get_text_property(globalconf.connection, |
92 | | event_notify->requestor, |
93 | | event_notify->property); |
| 91 | xcb_icccm_get_text_property(globalconf.connection, |
| 92 | event_notify->requestor, |
| 93 | event_notify->property); |
94 | 94 | |
95 | | if(xcb_get_text_property_reply(globalconf.connection, |
96 | | cookie, &prop, NULL)) |
| 95 | if(xcb_icccm_get_text_property_reply(globalconf.connection, |
| 96 | cookie, &prop, NULL)) |
97 | 97 | { |
98 | 98 | lua_pushlstring(L, prop.name, prop.name_len); |
99 | 99 | |
100 | | xcb_get_text_property_reply_wipe(&prop); |
| 100 | xcb_icccm_get_text_property_reply_wipe(&prop); |
101 | 101 | |
102 | 102 | xcb_delete_property(globalconf.connection, |
103 | 103 | event_notify->requestor, |
diff --git a/systray.c b/systray.c
index 6ea3dd5..92b7d39 100644
a
|
b
|
systray_request_handle(xcb_window_t embed_win, int phys_screen, xembed_info_t *i |
197 | 197 | |
198 | 198 | xcb_change_window_attributes(globalconf.connection, embed_win, XCB_CW_EVENT_MASK, |
199 | 199 | select_input_val); |
200 | | window_state_set(embed_win, XCB_WM_STATE_WITHDRAWN); |
| 200 | window_state_set(embed_win, XCB_ICCCM_WM_STATE_WITHDRAWN); |
201 | 201 | |
202 | 202 | /* we grab the window, but also make sure it's automatically reparented back |
203 | 203 | * to the root window if we should die. |
diff --git a/window.c b/window.c
index b86fa38..6a1909f 100644
a
|
b
|
uint32_t |
60 | 60 | window_state_get_reply(xcb_get_property_cookie_t cookie) |
61 | 61 | { |
62 | 62 | /* If no property is set, we just assume a sane default. */ |
63 | | uint32_t result = XCB_WM_STATE_NORMAL; |
| 63 | uint32_t result = XCB_ICCCM_WM_STATE_NORMAL; |
64 | 64 | xcb_get_property_reply_t *prop_r; |
65 | 65 | |
66 | 66 | if((prop_r = xcb_get_property_reply(globalconf.connection, cookie, NULL))) |
… |
… |
window_opacity_set(xcb_window_t win, double opacity) |
187 | 187 | { |
188 | 188 | uint32_t real_opacity = opacity * 0xffffffff; |
189 | 189 | xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win, |
190 | | _NET_WM_WINDOW_OPACITY, CARDINAL, 32, 1L, &real_opacity); |
| 190 | _NET_WM_WINDOW_OPACITY, XCB_ATOM_CARDINAL, 32, 1L, &real_opacity); |
191 | 191 | } |
192 | 192 | else |
193 | 193 | xcb_delete_property(globalconf.connection, win, _NET_WM_WINDOW_OPACITY); |