Hello, I have just sent an email announcing xcb-util split up[0], so here is a patch for Awesome following the split up. Hope that's ok.
Cheers, -- Arnaud Fontaine [0] http://lists.freedesktop.org/archives/xcb/2011-March/006778.html
>From bfc8deb95c59ce021aed66004674c41b86438412 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine <ar...@debian.org> Date: Sun, 19 Dec 2010 20:41:34 +0900 Subject: [PATCH] xcb-util library has been split, thus update the code accordingly --- awesome.c | 2 +- awesomeConfig.cmake | 5 +-- common/xutil.c | 1 - event.c | 2 +- objects/client.c | 56 +++++++++++++++++++++++++------------------------- objects/client.h | 6 ++-- property.c | 57 ++++++++++++++++++++++++++------------------------- selection.c | 16 +++++++------- systray.c | 2 +- xwindow.c | 2 +- 10 files changed, 74 insertions(+), 75 deletions(-) diff --git a/awesome.c b/awesome.c index 8749ccf..2424c45 100644 --- a/awesome.c +++ b/awesome.c @@ -128,7 +128,7 @@ scan(void) if(!attr_r || attr_r->override_redirect || attr_r->map_state == XCB_MAP_STATE_UNMAPPED - || state == XCB_WM_STATE_WITHDRAWN) + || state == XCB_ICCCM_WM_STATE_WITHDRAWN) { geom_wins[i] = NULL; p_delete(&attr_r); diff --git a/awesomeConfig.cmake b/awesomeConfig.cmake index aeb0b2b..d2100c2 100644 --- a/awesomeConfig.cmake +++ b/awesomeConfig.cmake @@ -137,10 +137,9 @@ pkg_check_modules(AWESOME_REQUIRED REQUIRED xcb-randr xcb-xtest xcb-xinerama - xcb-aux>=0.3.0 - xcb-atom>=0.3.0 + xcb-util>=0.3.8 xcb-keysyms>=0.3.4 - xcb-icccm>=0.3.6 + xcb-icccm>=0.3.8 xcb-image>=0.3.0 cairo-xcb libstartup-notification-1.0>=0.10 diff --git a/common/xutil.c b/common/xutil.c index fd53d9c..8b62da7 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -25,7 +25,6 @@ #include "common/util.h" #include <xcb/xcb.h> -#include <xcb/xcb_atom.h> #include <xcb/xcb_icccm.h> #include "common/xutil.h" diff --git a/event.c b/event.c index a892851..20d2947 100644 --- a/event.c +++ b/event.c @@ -619,7 +619,7 @@ event_handle_clientmessage(xcb_client_message_event_t *ev) client_t *c; if((c = client_getbywin(ev->window)) && ev->format == 32 - && ev->data.data32[0] == XCB_WM_STATE_ICONIC) + && ev->data.data32[0] == XCB_ICCCM_WM_STATE_ICONIC) { luaA_object_push(globalconf.L, c); client_set_minimized(globalconf.L, -1, true); diff --git a/objects/client.c b/objects/client.c index 5934822..09423e3 100644 --- a/objects/client.c +++ b/objects/client.c @@ -41,7 +41,7 @@ static void client_wipe(client_t *c) { key_array_wipe(&c->keys); - xcb_get_wm_protocols_reply_wipe(&c->protocols); + xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols); p_delete(&c->machine); p_delete(&c->class); p_delete(&c->instance); @@ -66,20 +66,20 @@ client_set_urgent(lua_State *L, int cidx, bool urgent) if(c->urgent != urgent) { xcb_get_property_cookie_t hints = - xcb_get_wm_hints_unchecked(globalconf.connection, c->window); + xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window); c->urgent = urgent; /* update ICCCM hints */ - xcb_wm_hints_t wmh; - xcb_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL); + xcb_icccm_wm_hints_t wmh; + xcb_icccm_get_wm_hints_reply(globalconf.connection, hints, &wmh, NULL); if(urgent) - wmh.flags |= XCB_WM_HINT_X_URGENCY; + wmh.flags |= XCB_ICCCM_WM_HINT_X_URGENCY; else - wmh.flags &= ~XCB_WM_HINT_X_URGENCY; + wmh.flags &= ~XCB_ICCCM_WM_HINT_X_URGENCY; - xcb_set_wm_hints(globalconf.connection, c->window, &wmh); + xcb_icccm_set_wm_hints(globalconf.connection, c->window, &wmh); luaA_object_emit_signal(L, cidx, "property::urgent", 0); } @@ -509,7 +509,7 @@ HANDLE_GEOM(height) * * At this stage it's just safer to keep it in normal state and avoid confusion. */ - xwindow_set_state(c->window, XCB_WM_STATE_NORMAL); + xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL); if(!startup) { @@ -545,14 +545,14 @@ client_geometry_hints(client_t *c, area_t geometry) int32_t real_basew = 0, real_baseh = 0; /* base size is substituted with min size if not specified */ - if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) { basew = c->size_hints.base_width; baseh = c->size_hints.base_height; real_basew = basew; real_baseh = baseh; } - else if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) + else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { basew = c->size_hints.min_width; baseh = c->size_hints.min_height; @@ -561,12 +561,12 @@ client_geometry_hints(client_t *c, area_t geometry) basew = baseh = 0; /* min size is substituted with base size if not specified */ - if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { minw = c->size_hints.min_width; minh = c->size_hints.min_height; } - else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) + else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) { minw = c->size_hints.base_width; minh = c->size_hints.base_height; @@ -574,7 +574,7 @@ client_geometry_hints(client_t *c, area_t geometry) else minw = minh = 0; - if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT && c->size_hints.min_aspect_den > 0 && c->size_hints.max_aspect_den > 0 && geometry.height - real_baseh > 0 @@ -616,7 +616,7 @@ client_geometry_hints(client_t *c, area_t geometry) if(minh) geometry.height = MAX(geometry.height, minh); - if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) { if(c->size_hints.max_width) geometry.width = MIN(geometry.width, c->size_hints.max_width); @@ -624,7 +624,7 @@ client_geometry_hints(client_t *c, area_t geometry) geometry.height = MIN(geometry.height, c->size_hints.max_height); } - if(c->size_hints.flags & (XCB_SIZE_HINT_P_RESIZE_INC | XCB_SIZE_HINT_BASE_SIZE) + if(c->size_hints.flags & (XCB_ICCCM_SIZE_HINT_P_RESIZE_INC | XCB_ICCCM_SIZE_HINT_BASE_SIZE) && c->size_hints.width_inc && c->size_hints.height_inc) { uint16_t t1 = geometry.width, t2 = geometry.height; @@ -730,9 +730,9 @@ client_set_minimized(lua_State *L, int cidx, bool s) c->minimized = s; banning_need_update((c)->screen); if(s) - xwindow_set_state(c->window, XCB_WM_STATE_ICONIC); + xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_ICONIC); else - xwindow_set_state(c->window, XCB_WM_STATE_NORMAL); + xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_NORMAL); if(strut_has_value(&c->strut)) screen_emit_signal(globalconf.L, c->screen, "property::workarea", 0); luaA_object_emit_signal(L, cidx, "property::minimized", 0); @@ -995,7 +995,7 @@ client_unmanage(client_t *c, bool window_valid) /* Do this last to avoid races with clients. According to ICCCM, clients * arent allowed to re-use the window until after this. */ - xwindow_set_state(c->window, XCB_WM_STATE_WITHDRAWN); + xwindow_set_state(c->window, XCB_ICCCM_WM_STATE_WITHDRAWN); } /* set client as invalid */ @@ -1516,9 +1516,9 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_createtable(L, 0, 1); - if(c->size_hints.flags & XCB_SIZE_HINT_US_POSITION) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION) u_or_p = "user_position"; - else if(c->size_hints.flags & XCB_SIZE_HINT_P_POSITION) + else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION) u_or_p = "program_position"; if(u_or_p) @@ -1532,9 +1532,9 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) u_or_p = NULL; } - if(c->size_hints.flags & XCB_SIZE_HINT_US_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE) u_or_p = "user_size"; - else if(c->size_hints.flags & XCB_SIZE_HINT_P_SIZE) + else if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) u_or_p = "program_size"; if(u_or_p) @@ -1547,7 +1547,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, u_or_p); } - if(c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE) { lua_pushnumber(L, c->size_hints.min_width); lua_setfield(L, -2, "min_width"); @@ -1555,7 +1555,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, "min_height"); } - if(c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE) { lua_pushnumber(L, c->size_hints.max_width); lua_setfield(L, -2, "max_width"); @@ -1563,7 +1563,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, "max_height"); } - if(c->size_hints.flags & XCB_SIZE_HINT_P_RESIZE_INC) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC) { lua_pushnumber(L, c->size_hints.width_inc); lua_setfield(L, -2, "width_inc"); @@ -1571,7 +1571,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, "height_inc"); } - if(c->size_hints.flags & XCB_SIZE_HINT_P_ASPECT) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_ASPECT) { lua_pushnumber(L, c->size_hints.min_aspect_num); lua_setfield(L, -2, "min_aspect_num"); @@ -1583,7 +1583,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, "max_aspect_den"); } - if(c->size_hints.flags & XCB_SIZE_HINT_BASE_SIZE) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) { lua_pushnumber(L, c->size_hints.base_width); lua_setfield(L, -2, "base_width"); @@ -1591,7 +1591,7 @@ luaA_client_get_size_hints(lua_State *L, client_t *c) lua_setfield(L, -2, "base_height"); } - if(c->size_hints.flags & XCB_SIZE_HINT_P_WIN_GRAVITY) + if(c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_WIN_GRAVITY) { switch(c->size_hints.win_gravity) { diff --git a/objects/client.h b/objects/client.h index ec63537..ecb1d6d 100644 --- a/objects/client.h +++ b/objects/client.h @@ -83,7 +83,7 @@ struct client_t /** Window holding command needed to start it (session management related) */ xcb_window_t leader_window; /** Client's WM_PROTOCOLS property */ - xcb_get_wm_protocols_reply_t protocols; + xcb_icccm_get_wm_protocols_reply_t protocols; /** Key bindings */ key_array_t keys; /** Icon */ @@ -186,8 +186,8 @@ client_raise(client_t *c) static inline bool client_isfixed(client_t *c) { - return (c->size_hints.flags & XCB_SIZE_HINT_P_MAX_SIZE - && c->size_hints.flags & XCB_SIZE_HINT_P_MIN_SIZE + return (c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MAX_SIZE + && c->size_hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE && c->size_hints.max_width == c->size_hints.min_width && c->size_hints.max_height == c->size_hints.min_height && c->size_hints.max_width diff --git a/property.c b/property.c index 9c4378d..989bb7d 100644 --- a/property.c +++ b/property.c @@ -98,7 +98,7 @@ HANDLE_PROPERTY(net_wm_pid) xcb_get_property_cookie_t property_get_wm_transient_for(client_t *c) { - return xcb_get_wm_transient_for_unchecked(globalconf.connection, c->window); + return xcb_icccm_get_wm_transient_for_unchecked(globalconf.connection, c->window); } void @@ -106,9 +106,9 @@ property_update_wm_transient_for(client_t *c, xcb_get_property_cookie_t cookie) { xcb_window_t trans; - if(!xcb_get_wm_transient_for_reply(globalconf.connection, - cookie, - &trans, NULL)) + if(!xcb_icccm_get_wm_transient_for_reply(globalconf.connection, + cookie, + &trans, NULL)) return; luaA_object_push(globalconf.L, c); @@ -146,7 +146,7 @@ property_update_wm_client_leader(client_t *c, xcb_get_property_cookie_t cookie) xcb_get_property_cookie_t property_get_wm_normal_hints(client_t *c) { - return xcb_get_wm_normal_hints_unchecked(globalconf.connection, c->window); + return xcb_icccm_get_wm_normal_hints_unchecked(globalconf.connection, c->window); } /** Update the size hints of a client. @@ -156,15 +156,15 @@ property_get_wm_normal_hints(client_t *c) void property_update_wm_normal_hints(client_t *c, xcb_get_property_cookie_t cookie) { - xcb_get_wm_normal_hints_reply(globalconf.connection, - cookie, - &c->size_hints, NULL); + xcb_icccm_get_wm_normal_hints_reply(globalconf.connection, + cookie, + &c->size_hints, NULL); } xcb_get_property_cookie_t property_get_wm_hints(client_t *c) { - return xcb_get_wm_hints_unchecked(globalconf.connection, c->window); + return xcb_icccm_get_wm_hints_unchecked(globalconf.connection, c->window); } /** Update the WM hints of a client. @@ -174,20 +174,20 @@ property_get_wm_hints(client_t *c) void property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie) { - xcb_wm_hints_t wmh; + xcb_icccm_wm_hints_t wmh; - if(!xcb_get_wm_hints_reply(globalconf.connection, - cookie, - &wmh, NULL)) + if(!xcb_icccm_get_wm_hints_reply(globalconf.connection, + cookie, + &wmh, NULL)) return; luaA_object_push(globalconf.L, c); - client_set_urgent(globalconf.L, -1, xcb_wm_hints_get_urgency(&wmh)); + client_set_urgent(globalconf.L, -1, xcb_icccm_wm_hints_get_urgency(&wmh)); - if(wmh.flags & XCB_WM_HINT_INPUT) + if(wmh.flags & XCB_ICCCM_WM_HINT_INPUT) c->nofocus = !wmh.input; - if(wmh.flags & XCB_WM_HINT_WINDOW_GROUP) + if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP) client_set_group_window(globalconf.L, -1, wmh.window_group); lua_pop(globalconf.L, 1); @@ -196,7 +196,7 @@ property_update_wm_hints(client_t *c, xcb_get_property_cookie_t cookie) xcb_get_property_cookie_t property_get_wm_class(client_t *c) { - return xcb_get_wm_class_unchecked(globalconf.connection, c->window); + return xcb_icccm_get_wm_class_unchecked(globalconf.connection, c->window); } /** Update WM_CLASS of a client. @@ -206,18 +206,18 @@ property_get_wm_class(client_t *c) void property_update_wm_class(client_t *c, xcb_get_property_cookie_t cookie) { - xcb_get_wm_class_reply_t hint; + xcb_icccm_get_wm_class_reply_t hint; - if(!xcb_get_wm_class_reply(globalconf.connection, - cookie, - &hint, NULL)) + if(!xcb_icccm_get_wm_class_reply(globalconf.connection, + cookie, + &hint, NULL)) return; luaA_object_push(globalconf.L, c); client_set_class_instance(globalconf.L, -1, hint.class_name, hint.instance_name); lua_pop(globalconf.L, 1); - xcb_get_wm_class_reply_wipe(&hint); + xcb_icccm_get_wm_class_reply_wipe(&hint); } static int @@ -284,7 +284,8 @@ property_update_net_wm_pid(client_t *c, xcb_get_property_cookie_t cookie) xcb_get_property_cookie_t property_get_wm_protocols(client_t *c) { - return xcb_get_wm_protocols_unchecked(globalconf.connection, c->window, WM_PROTOCOLS); + return xcb_icccm_get_wm_protocols_unchecked(globalconf.connection, + c->window, WM_PROTOCOLS); } /** Update the list of supported protocols for a client. @@ -294,15 +295,15 @@ property_get_wm_protocols(client_t *c) void property_update_wm_protocols(client_t *c, xcb_get_property_cookie_t cookie) { - xcb_get_wm_protocols_reply_t protocols; + xcb_icccm_get_wm_protocols_reply_t protocols; /* If this fails for any reason, we still got the old value */ - if(!xcb_get_wm_protocols_reply(globalconf.connection, - cookie, - &protocols, NULL)) + if(!xcb_icccm_get_wm_protocols_reply(globalconf.connection, + cookie, + &protocols, NULL)) return; - xcb_get_wm_protocols_reply_wipe(&c->protocols); + xcb_icccm_get_wm_protocols_reply_wipe(&c->protocols); memcpy(&c->protocols, &protocols, sizeof(protocols)); } diff --git a/selection.c b/selection.c index 2218869..59a04e7 100644 --- a/selection.c +++ b/selection.c @@ -86,18 +86,18 @@ luaA_selection_get(lua_State *L) if(event_notify->selection == XCB_ATOM_PRIMARY && event_notify->property != XCB_NONE) { - xcb_get_text_property_reply_t prop; + xcb_icccm_get_text_property_reply_t prop; xcb_get_property_cookie_t cookie = - xcb_get_text_property(globalconf.connection, - event_notify->requestor, - event_notify->property); + xcb_icccm_get_text_property(globalconf.connection, + event_notify->requestor, + event_notify->property); - if(xcb_get_text_property_reply(globalconf.connection, - cookie, &prop, NULL)) - { + if(xcb_icccm_get_text_property_reply(globalconf.connection, + cookie, &prop, NULL)) + { lua_pushlstring(L, prop.name, prop.name_len); - xcb_get_text_property_reply_wipe(&prop); + xcb_icccm_get_text_property_reply_wipe(&prop); xcb_delete_property(globalconf.connection, event_notify->requestor, diff --git a/systray.c b/systray.c index fc7a87b..280a727 100644 --- a/systray.c +++ b/systray.c @@ -164,7 +164,7 @@ systray_request_handle(xcb_window_t embed_win, xembed_info_t *info) xcb_change_window_attributes(globalconf.connection, embed_win, XCB_CW_EVENT_MASK, select_input_val); - xwindow_set_state(embed_win, XCB_WM_STATE_WITHDRAWN); + xwindow_set_state(embed_win, XCB_ICCCM_WM_STATE_WITHDRAWN); /* we grab the window, but also make sure it's automatically reparented back * to the root window if we should die. diff --git a/xwindow.c b/xwindow.c index 3514dfb..22b505e 100644 --- a/xwindow.c +++ b/xwindow.c @@ -60,7 +60,7 @@ uint32_t xwindow_get_state_reply(xcb_get_property_cookie_t cookie) { /* If no property is set, we just assume a sane default. */ - uint32_t result = XCB_WM_STATE_NORMAL; + uint32_t result = XCB_ICCCM_WM_STATE_NORMAL; xcb_get_property_reply_t *prop_r; if((prop_r = xcb_get_property_reply(globalconf.connection, cookie, NULL))) -- 1.7.4.1