From 02c99fccb859db926349523cf7f8f77e46e1cf96 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Wed, 26 Mar 2008 18:58:30 +0000 Subject: [PATCH] Prefix xutil functions properly --- awesome-menu.c | 9 +++------ awesome-message.c | 4 ++-- awesome.c | 11 ++++------- client.c | 24 ++++++++++++------------ common/swindow.c | 6 +++--- common/xutil.c | 10 +++++----- common/xutil.h | 8 ++++---- event.c | 16 ++++++++-------- ewmh.c | 14 +++++++------- layout.c | 4 ++-- mouse.c | 12 ++++++------ placement.c | 2 +- rules.c | 4 ++-- screen.c | 2 +- statusbar.c | 2 +- titlebar.c | 2 +- window.c | 32 ++++++++++++++++---------------- 17 files changed, 78 insertions(+), 84 deletions(-) diff --git a/awesome-menu.c b/awesome-menu.c index 79c39276..501417c7 100644 --- a/awesome-menu.c +++ b/awesome-menu.c @@ -847,16 +847,13 @@ main(int argc, char **argv) if(xcb_connection_has_error(globalconf.connection)) eprint("unable to open display"); - /* Get the numlock mask */ - globalconf.numlockmask = xgetnumlockmask(globalconf.connection); - si = screensinfo_new(globalconf.connection); if(si->xinerama_is_active) { if((xqp = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer(globalconf.connection, - root_window(globalconf.connection, - globalconf.default_screen)), + xutil_root_window(globalconf.connection, + globalconf.default_screen)), NULL)) != NULL) { screen = screen_get_bycoord(si, 0, xqp->root_x, xqp->root_y); @@ -924,7 +921,7 @@ main(int argc, char **argv) globalconf.keysyms = xcb_key_symbols_alloc(globalconf.connection); /* Get the numlock, capslock and shiftlock mask */ - xutil_get_lock_mask(conn, globalconf.keysyms, &globalconf.numlockmask, + xutil_get_lock_mask(globalconf.connection, globalconf.keysyms, &globalconf.numlockmask, &globalconf.shiftlockmask, &globalconf.capslockmask); xutil_map_raised(globalconf.connection, globalconf.sw->window); diff --git a/awesome-message.c b/awesome-message.c index d1a40a77..27ec7fec 100644 --- a/awesome-message.c +++ b/awesome-message.c @@ -174,8 +174,8 @@ main(int argc, char **argv) { if((xqp = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer(globalconf.connection, - root_window(globalconf.connection, - globalconf.default_screen)), + xutil_root_window(globalconf.connection, + globalconf.default_screen)), NULL)) != NULL) { screen = screen_get_bycoord(si, 0, xqp->root_x, xqp->root_y); diff --git a/awesome.c b/awesome.c index 0193cd2b..c0e33bb6 100644 --- a/awesome.c +++ b/awesome.c @@ -112,7 +112,7 @@ scan() for(screen = 0; screen < screen_max; screen++) { - w = root_window(globalconf.connection, screen); + w = xutil_root_window(globalconf.connection, screen); /* Get parent geometry informations, useful to get the real * coordinates of the window because Xlib set 'x' and 'y' @@ -389,13 +389,10 @@ main(int argc, char *argv[]) for(screen_nbr = 0; screen_nbr < xcb_setup_roots_length(xcb_get_setup(conn)); screen_nbr++) - { - /* this causes an error if some other window manager is - * running */ + /* this causes an error if some other window manager is running */ xcb_change_window_attributes(conn, - root_window(conn, screen_nbr), + xutil_root_window(conn, screen_nbr), XCB_CW_EVENT_MASK, &select_input_val); - } /* need to xcb_flush to validate error handler */ xcb_aux_sync(conn); @@ -462,7 +459,7 @@ main(int argc, char *argv[]) screen_nbr++) { xcb_change_window_attributes(globalconf.connection, - root_window(globalconf.connection, screen_nbr), + xutil_root_window(globalconf.connection, screen_nbr), XCB_CW_EVENT_MASK | XCB_CW_CURSOR, change_win_vals); ewmh_set_supported_hints(screen_nbr); diff --git a/client.c b/client.c index 253f211b..72cd9247 100644 --- a/client.c +++ b/client.c @@ -63,7 +63,7 @@ client_loadprops(Client * c, int screen) prop = p_new(char, ntags + 3); if(xgettextprop(globalconf.connection, c->win, - x_intern_atom(globalconf.connection, "_AWESOME_PROPERTIES"), + xutil_intern_atom(globalconf.connection, "_AWESOME_PROPERTIES"), prop, ntags + 3)) { for(i = 0, tag = globalconf.screens[screen].tags; tag && i < ntags && prop[i]; i++, tag = tag->next) @@ -99,7 +99,7 @@ client_isprotodel(xcb_connection_t *c, xcb_window_t win) if(xcb_get_wm_protocols(c, win, &n, &protocols)) { for(i = 0; !ret && i < n; i++) - if(protocols[i] == x_intern_atom(c, "WM_DELETE_WINDOW")) + if(protocols[i] == xutil_intern_atom(c, "WM_DELETE_WINDOW")) ret = true; p_delete(&protocols); } @@ -144,9 +144,9 @@ void client_updatetitle(Client *c) { if(!xgettextprop(globalconf.connection, c->win, - x_intern_atom(globalconf.connection, "_NET_WM_NAME"), c->name, sizeof(c->name))) + xutil_intern_atom(globalconf.connection, "_NET_WM_NAME"), c->name, sizeof(c->name))) xgettextprop(globalconf.connection, c->win, - x_intern_atom(globalconf.connection, "WM_NAME"), c->name, sizeof(c->name)); + xutil_intern_atom(globalconf.connection, "WM_NAME"), c->name, sizeof(c->name)); titlebar_draw(c); @@ -233,7 +233,7 @@ client_focus(Client *c, int screen, bool raise) phys_screen = screen_virttophys(screen); xcb_set_input_focus(globalconf.connection, XCB_INPUT_FOCUS_POINTER_ROOT, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), XCB_CURRENT_TIME); } @@ -379,7 +379,7 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, int screen) } /* check for transient and set tags like its parent */ - if((rettrans = x_get_transient_for_hint(globalconf.connection, w, &trans)) + if((rettrans = xutil_get_transient_for_hint(globalconf.connection, w, &trans)) && (t = client_get_bywin(globalconf.clients, trans))) for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next) if(is_client_tagged(t, tag)) @@ -638,7 +638,7 @@ client_saveprops(Client *c) prop[++i] = '\0'; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, c->win, - x_intern_atom(globalconf.connection, "_AWESOME_PROPERTIES"), + xutil_intern_atom(globalconf.connection, "_AWESOME_PROPERTIES"), STRING, 8, i, (unsigned char *) prop); p_delete(&prop); @@ -691,7 +691,7 @@ client_unmanage(Client *c) void client_updatewmhints(Client *c) { - xcb_wm_hints_t *wmh; + xcb_wm_hints_t *wmh = NULL; if((wmh = xcb_get_wm_hints(globalconf.connection, c->win))) { @@ -799,7 +799,7 @@ uicb_client_settrans(int screen __attribute__ ((unused)), char *arg) prop_r = xcb_get_property_reply(globalconf.connection, xcb_get_property_unchecked(globalconf.connection, false, sel->win, - x_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY"), + xutil_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY"), CARDINAL, 0, 1), NULL); @@ -927,7 +927,7 @@ uicb_client_moveresize(int screen, char *arg) xqp = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer_unchecked(globalconf.connection, - root_window(globalconf.connection, sel->phys_screen)), + xutil_root_window(globalconf.connection, sel->phys_screen)), NULL); if(globalconf.screens[sel->screen].resize_hints) geometry = client_geometry_hints(sel, geometry); @@ -961,9 +961,9 @@ client_kill(Client *c) if(client_isprotodel(globalconf.connection, c->win)) { ev.window = c->win; - ev.type = x_intern_atom(globalconf.connection, "WM_PROTOCOLS"); + ev.type = xutil_intern_atom(globalconf.connection, "WM_PROTOCOLS"); - ev.data.data32[0] = x_intern_atom(globalconf.connection, "WM_DELETE_WINDOW"); + ev.data.data32[0] = xutil_intern_atom(globalconf.connection, "WM_DELETE_WINDOW"); ev.data.data32[1] = XCB_CURRENT_TIME; /* TODO: really useful? */ diff --git a/common/swindow.c b/common/swindow.c index 1883222a..71dce35a 100644 --- a/common/swindow.c +++ b/common/swindow.c @@ -62,7 +62,7 @@ simplewindow_new(xcb_connection_t *conn, int phys_screen, int x, int y, sw->window = xcb_generate_id(conn); xcb_create_window(conn, s->root_depth, sw->window, - root_window(conn, phys_screen), + xutil_root_window(conn, phys_screen), x, y, w, h, border_width, XCB_COPY_FROM_PARENT, s->root_visual, @@ -71,7 +71,7 @@ simplewindow_new(xcb_connection_t *conn, int phys_screen, int x, int y, sw->drawable = xcb_generate_id(conn); xcb_create_pixmap(conn, s->root_depth, sw->drawable, - root_window(conn, phys_screen), w, h); + xutil_root_window(conn, phys_screen), w, h); return sw; } @@ -120,7 +120,7 @@ simplewindow_resize(SimpleWindow *sw, unsigned int w, unsigned int h) xcb_free_pixmap(sw->connection, sw->drawable); sw->drawable = xcb_generate_id(sw->connection); xcb_create_pixmap(sw->connection, s->root_depth, sw->drawable, - root_window(sw->connection, sw->phys_screen), w, h); + xutil_root_window(sw->connection, sw->phys_screen), w, h); xcb_configure_window(sw->connection, sw->window, XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, resize_win_vals); diff --git a/common/xutil.c b/common/xutil.c index a670dfb3..707976a2 100644 --- a/common/xutil.c +++ b/common/xutil.c @@ -112,7 +112,7 @@ xutil_get_lock_mask(xcb_connection_t *conn, xcb_key_symbols_t *keysyms, * \return return true if successfull */ bool -x_get_transient_for_hint(xcb_connection_t *c, xcb_window_t win, +xutil_get_transient_for_hint(xcb_connection_t *c, xcb_window_t win, xcb_window_t *prop_win) { xcb_get_property_reply_t *r; @@ -141,13 +141,13 @@ x_get_transient_for_hint(xcb_connection_t *c, xcb_window_t win, } xcb_window_t -root_window(xcb_connection_t *c, int screen_number) +xutil_root_window(xcb_connection_t *c, int screen_number) { return xcb_aux_get_screen(c, screen_number)->root; } xcb_atom_t -x_intern_atom(xcb_connection_t *c, const char *property) +xutil_intern_atom(xcb_connection_t *c, const char *property) { xcb_atom_t atom; xcb_intern_atom_reply_t *r_atom; @@ -166,7 +166,7 @@ x_intern_atom(xcb_connection_t *c, const char *property) } class_hint_t * -x_get_class_hint(xcb_connection_t *conn, xcb_window_t win) +xutil_get_class_hint(xcb_connection_t *conn, xcb_window_t win) { xcb_get_property_reply_t *r = NULL; char *data = NULL; @@ -182,7 +182,7 @@ x_get_class_hint(xcb_connection_t *conn, xcb_window_t win) STRING, 0L, 2048), NULL); - if(!r || r->type != STRING || r->format == 8) + if(!r || r->type != STRING || r->format != 8) return NULL; data = xcb_get_property_value(r); diff --git a/common/xutil.h b/common/xutil.h index e9fc2436..f9aa3fff 100644 --- a/common/xutil.h +++ b/common/xutil.h @@ -78,8 +78,8 @@ void xutil_get_lock_mask(xcb_connection_t *, xcb_key_symbols_t *, /* End of macros not defined in XCB */ /* Common function defined in Xlib but not in XCB */ -bool x_get_transient_for_hint(xcb_connection_t *, xcb_window_t, xcb_window_t *); -xcb_window_t root_window(xcb_connection_t *, int); +bool xutil_get_transient_for_hint(xcb_connection_t *, xcb_window_t, xcb_window_t *); +xcb_window_t xutil_root_window(xcb_connection_t *, int); typedef struct _class_hint_t { @@ -95,14 +95,14 @@ typedef struct uint16_t blue; } xcolor_t; -class_hint_t *x_get_class_hint(xcb_connection_t *, xcb_window_t); +class_hint_t *xutil_get_class_hint(xcb_connection_t *, xcb_window_t); /* Equivalent call to XInternAtom * * WARNING: should not be used in loop, in this case, it should send * the queries first and then treat the answer as late as possible) */ -xcb_atom_t x_intern_atom(xcb_connection_t *, const char *); +xcb_atom_t xutil_intern_atom(xcb_connection_t *, const char *); /* Equivalent XCB call to XMapRaised, which actually raises the specified window to the top of the stack and maps it */ diff --git a/event.c b/event.c index 2801882d..831d2007 100644 --- a/event.c +++ b/event.c @@ -154,7 +154,7 @@ event_handle_buttonpress(void *data __attribute__ ((unused)), } else for(screen = 0; screen < xcb_setup_roots_length(xcb_get_setup (connection)); screen++) - if(root_window(connection, screen) == ev->event + if(xutil_root_window(connection, screen) == ev->event && (qr = xcb_query_pointer_reply(connection, xcb_query_pointer(connection, ev->event), NULL)) != NULL) @@ -274,7 +274,7 @@ event_handle_configurenotify(void *data __attribute__ ((unused)), const xcb_screen_t *screen; for(screen_nbr = 0; screen_nbr < xcb_setup_roots_length(xcb_get_setup (connection)); screen_nbr++) - if(ev->window == root_window(connection, screen_nbr) + if(ev->window == xutil_root_window(connection, screen_nbr) && (screen = xcb_aux_get_screen(connection, screen_nbr)) != NULL && (ev->width != screen->width_in_pixels || ev->height != screen->height_in_pixels)) @@ -336,7 +336,7 @@ event_handle_enternotify(void *data __attribute__ ((unused)), } else for(screen = 0; screen < xcb_setup_roots_length(xcb_get_setup(connection)); screen++) - if(ev->event == root_window(connection, screen)) + if(ev->event == xutil_root_window(connection, screen)) { window_root_grabbuttons(screen); return 0; @@ -395,7 +395,7 @@ event_handle_keypress(void *data __attribute__ ((unused)), for(screen = 0; screen < xcb_setup_roots_length (xcb_get_setup (connection)); screen++) if((qpr = xcb_query_pointer_reply(connection, xcb_query_pointer(connection, - root_window(connection, screen)), + xutil_root_window(connection, screen)), NULL)) != NULL) { /* if screen is 0, we are on first Zaphod screen or on the @@ -466,7 +466,7 @@ event_handle_maprequest(void *data __attribute__ ((unused)), if(globalconf.screens_info->xinerama_is_active && (qpr = xcb_query_pointer_reply(connection, xcb_query_pointer(connection, - root_window(globalconf.connection, screen_nbr)), + xutil_root_window(globalconf.connection, screen_nbr)), NULL)) != NULL) screen_nbr = screen_get_bycoord(globalconf.screens_info, screen_nbr, qpr->root_x, qpr->root_y); else @@ -500,7 +500,7 @@ event_handle_propertynotify(void *data __attribute__ ((unused)), { if(ev->atom == WM_TRANSIENT_FOR) { - x_get_transient_for_hint(connection, c->win, &trans); + xutil_get_transient_for_hint(connection, c->win, &trans); if(!c->isfloating && (c->isfloating = (client_get_bywin(globalconf.clients, trans) != NULL))) globalconf.screens[c->screen].need_arrange = true; @@ -510,7 +510,7 @@ event_handle_propertynotify(void *data __attribute__ ((unused)), else if (ev->atom == WM_HINTS) client_updatewmhints(c); - if(ev->atom == WM_NAME || ev->atom == x_intern_atom(globalconf.connection, "_NET_WM_NAME")) + if(ev->atom == WM_NAME || ev->atom == xutil_intern_atom(globalconf.connection, "_NET_WM_NAME")) client_updatetitle(c); } @@ -535,7 +535,7 @@ event_handle_unmapnotify(void *data __attribute__ ((unused)), bool send_event = ((ev->response_type & 0x80) >> 7); if((c = client_get_bywin(globalconf.clients, ev->window)) - && ev->event == root_window(connection, c->phys_screen) + && ev->event == xutil_root_window(connection, c->phys_screen) && send_event && window_getstate(c->win) == XCB_WM_NORMAL_STATE) client_unmanage(c); diff --git a/ewmh.c b/ewmh.c index d2a4454b..17d86548 100644 --- a/ewmh.c +++ b/ewmh.c @@ -157,7 +157,7 @@ ewmh_set_supported_hints(int phys_screen) atom[i++] = net_wm_state_below; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_supported, ATOM, 32, i, atom); } @@ -178,7 +178,7 @@ ewmh_update_net_client_list(int phys_screen) wins[n] = c->win; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_client_list, WINDOW, 32, n, wins); p_delete(&wins); @@ -194,7 +194,7 @@ ewmh_update_net_numbers_of_desktop(int phys_screen) count++; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_number_of_desktops, CARDINAL, 32, 1, &count); } @@ -208,7 +208,7 @@ ewmh_update_net_current_desktop(int phys_screen) count++; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_current_desktop, CARDINAL, 32, 1, &count); p_delete(&curtags); @@ -232,7 +232,7 @@ ewmh_update_net_desktop_names(int phys_screen) } xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_desktop_names, utf8_string, 8, len, buf); } @@ -245,7 +245,7 @@ ewmh_update_net_active_window(int phys_screen) win = sel ? sel->win : XCB_NONE; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), net_active_window, WINDOW, 32, 1, &win); } @@ -362,7 +362,7 @@ ewmh_process_client_message(xcb_client_message_event_t *ev) screen < xcb_setup_roots_length(xcb_get_setup(globalconf.connection)); screen++) { - if(ev->window == root_window(globalconf.connection, screen)) + if(ev->window == xutil_root_window(globalconf.connection, screen)) tag_view_only_byindex(screen, ev->data.data32[0]); } diff --git a/layout.c b/layout.c index eab2497f..0316e4a4 100644 --- a/layout.c +++ b/layout.c @@ -80,8 +80,8 @@ arrange(int screen) /* check that the mouse is on a window or not */ if((xqp = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer_unchecked(globalconf.connection, - root_window(globalconf.connection, - phys_screen)), + xutil_root_window(globalconf.connection, + phys_screen)), NULL)) != NULL && (xqp->root == XCB_NONE || xqp->child == XCB_NONE || xqp->root == xqp->child)) { diff --git a/mouse.c b/mouse.c index 51fffddc..5aaf0fb2 100644 --- a/mouse.c +++ b/mouse.c @@ -151,16 +151,16 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) if(!c || xcb_grab_pointer_reply(globalconf.connection, xcb_grab_pointer(globalconf.connection, false, - root_window(globalconf.connection, c->phys_screen), + xutil_root_window(globalconf.connection, c->phys_screen), MOUSEMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, - root_window(globalconf.connection, c->phys_screen), + xutil_root_window(globalconf.connection, c->phys_screen), globalconf.cursor[CurMove], XCB_CURRENT_TIME), NULL)) return; query_pointer_r = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer_unchecked(globalconf.connection, - root_window(globalconf.connection, c->phys_screen)), + xutil_root_window(globalconf.connection, c->phys_screen)), NULL); geometry = c->geometry; @@ -230,7 +230,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) { mquery_pointer_r = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer_unchecked(globalconf.connection, - root_window(globalconf.connection, c->phys_screen)), + xutil_root_window(globalconf.connection, c->phys_screen)), NULL); if((newscreen = screen_get_bycoord(globalconf.screens_info, c->screen, mquery_pointer_r->root_x, @@ -336,9 +336,9 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused))) return; grab_pointer_c = xcb_grab_pointer(globalconf.connection, false, - root_window(globalconf.connection, c->phys_screen), + xutil_root_window(globalconf.connection, c->phys_screen), MOUSEMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, - root_window(globalconf.connection, c->phys_screen), + xutil_root_window(globalconf.connection, c->phys_screen), globalconf.cursor[CurResize], XCB_CURRENT_TIME); if(layout->arrange == layout_floating || c->isfloating) diff --git a/placement.c b/placement.c index e96eea9a..175a73a5 100644 --- a/placement.c +++ b/placement.c @@ -133,7 +133,7 @@ placement_under_mouse(Client *c) if((xqp = xcb_query_pointer_reply(globalconf.connection, xcb_query_pointer(globalconf.connection, - root_window(globalconf.connection, c->phys_screen)), + xutil_root_window(globalconf.connection, c->phys_screen)), NULL)) != NULL) { finalgeometry.x = xqp->root_x - c->f_geometry.width / 2; diff --git a/rules.c b/rules.c index 33a5441f..9d89ed28 100644 --- a/rules.c +++ b/rules.c @@ -53,7 +53,7 @@ client_match_rule(Client *c, Rule *r) if(r->prop_r) { /* first try to match on name */ - ch = x_get_class_hint(globalconf.connection, c->win); + ch = xutil_get_class_hint(globalconf.connection, c->win); if (!ch) return false; @@ -82,7 +82,7 @@ client_match_rule(Client *c, Rule *r) if(r->xprop && r->xpropval_r && xgettextprop(globalconf.connection, c->win, - x_intern_atom(globalconf.connection, r->xprop), + xutil_intern_atom(globalconf.connection, r->xprop), buf, ssizeof(buf))) ret = !regexec(r->xpropval_r, buf, 1, &tmp, 0); diff --git a/screen.c b/screen.c index 3a7b4a6a..f329f973 100644 --- a/screen.c +++ b/screen.c @@ -229,7 +229,7 @@ move_mouse_pointer_to_screen(int phys_screen) else xcb_warp_pointer(globalconf.connection, XCB_NONE, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), 0, 0, 0, 0, 0, 0); } diff --git a/statusbar.c b/statusbar.c index 5d7aa325..e5040a98 100644 --- a/statusbar.c +++ b/statusbar.c @@ -243,7 +243,7 @@ statusbar_init(Statusbar *statusbar) dw = xcb_generate_id(globalconf.connection); xcb_create_pixmap(globalconf.connection, s->root_depth, dw, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), statusbar->width, statusbar->height); statusbar->ctx = draw_context_new(globalconf.connection, phys_screen, diff --git a/titlebar.c b/titlebar.c index a18f033b..f670c585 100644 --- a/titlebar.c +++ b/titlebar.c @@ -172,7 +172,7 @@ titlebar_draw(Client *c) dw = xcb_generate_id(globalconf.connection); xcb_create_pixmap(globalconf.connection, s->root_depth, dw, - root_window(globalconf.connection, c->titlebar.sw->phys_screen), + xutil_root_window(globalconf.connection, c->titlebar.sw->phys_screen), c->titlebar.sw->geometry.height, c->titlebar.sw->geometry.width); ctx = draw_context_new(globalconf.connection, c->titlebar.sw->phys_screen, diff --git a/window.c b/window.c index 83a67365..28e64a98 100644 --- a/window.c +++ b/window.c @@ -43,8 +43,8 @@ window_setstate(xcb_window_t win, long state) long data[] = { state, XCB_NONE }; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win, - x_intern_atom(globalconf.connection, "WM_STATE"), - x_intern_atom(globalconf.connection, "WM_STATE"), 32, + xutil_intern_atom(globalconf.connection, "WM_STATE"), + xutil_intern_atom(globalconf.connection, "WM_STATE"), 32, 2, data); } @@ -58,7 +58,7 @@ window_getstate(xcb_window_t w) long result = -1; unsigned char *p = NULL; xcb_get_property_cookie_t prop_c; - xcb_atom_t wm_state_atom = x_intern_atom(globalconf.connection, "WM_STATE"); + xcb_atom_t wm_state_atom = xutil_intern_atom(globalconf.connection, "WM_STATE"); xcb_get_property_reply_t *prop_r; prop_c = xcb_get_property_unchecked(globalconf.connection, false, w, @@ -140,7 +140,7 @@ window_grabbuttons(xcb_window_t win, int phys_screen) } xcb_ungrab_button(globalconf.connection, XCB_BUTTON_INDEX_ANY, - root_window(globalconf.connection, phys_screen), ANY_MODIFIER); + xutil_root_window(globalconf.connection, phys_screen), ANY_MODIFIER); } /** Grab buttons on root window @@ -154,19 +154,19 @@ window_root_grabbuttons(int phys_screen) for(b = globalconf.buttons.root; b; b = b->next) { xcb_grab_button(globalconf.connection, false, - root_window(globalconf.connection, phys_screen), BUTTONMASK, + xutil_root_window(globalconf.connection, phys_screen), BUTTONMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_SYNC, XCB_NONE, XCB_NONE, b->button, b->mod); xcb_grab_button(globalconf.connection, false, - root_window(globalconf.connection, phys_screen), BUTTONMASK, + xutil_root_window(globalconf.connection, phys_screen), BUTTONMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_SYNC, XCB_NONE, XCB_NONE, b->button, b->mod | XCB_MOD_MASK_LOCK); xcb_grab_button(globalconf.connection, false, - root_window(globalconf.connection, phys_screen), BUTTONMASK, + xutil_root_window(globalconf.connection, phys_screen), BUTTONMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_SYNC, XCB_NONE, XCB_NONE, b->button, b->mod | globalconf.numlockmask); xcb_grab_button(globalconf.connection, false, - root_window(globalconf.connection, phys_screen), BUTTONMASK, + xutil_root_window(globalconf.connection, phys_screen), BUTTONMASK, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_SYNC, XCB_NONE, XCB_NONE, b->button, b->mod | globalconf.numlockmask | XCB_MOD_MASK_LOCK); } @@ -182,18 +182,18 @@ window_root_grabkeys(int phys_screen) xcb_keycode_t kc; xcb_ungrab_key(globalconf.connection, ANY_KEY, - root_window(globalconf.connection, phys_screen), ANY_MODIFIER); + xutil_root_window(globalconf.connection, phys_screen), ANY_MODIFIER); for(k = globalconf.keys; k; k = k->next) if((kc = k->keycode) || (k->keysym && (kc = xcb_key_symbols_get_keycode(globalconf.keysyms, k->keysym)))) { - xcb_grab_key(globalconf.connection, true, root_window(globalconf.connection, phys_screen), + xcb_grab_key(globalconf.connection, true, xutil_root_window(globalconf.connection, phys_screen), k->mod, kc, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); - xcb_grab_key(globalconf.connection, true, root_window(globalconf.connection, phys_screen), + xcb_grab_key(globalconf.connection, true, xutil_root_window(globalconf.connection, phys_screen), k->mod | XCB_MOD_MASK_LOCK, kc, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); - xcb_grab_key(globalconf.connection, true, root_window(globalconf.connection, phys_screen), + xcb_grab_key(globalconf.connection, true, xutil_root_window(globalconf.connection, phys_screen), k->mod | globalconf.numlockmask, kc, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); - xcb_grab_key(globalconf.connection, true, root_window(globalconf.connection, phys_screen), + xcb_grab_key(globalconf.connection, true, xutil_root_window(globalconf.connection, phys_screen), k->mod | globalconf.numlockmask | XCB_MOD_MASK_LOCK, kc, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC); } @@ -211,7 +211,7 @@ window_setshape(xcb_window_t win, int phys_screen) { xcb_shape_combine(globalconf.connection, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, XCB_SHAPE_SK_BOUNDING, - root_window(globalconf.connection, phys_screen), + xutil_root_window(globalconf.connection, phys_screen), 0, 0, win); p_delete(&r); @@ -227,12 +227,12 @@ window_settrans(xcb_window_t win, double opacity) { real_opacity = opacity * 0xffffffff; xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE, win, - x_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY"), + xutil_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY"), CARDINAL, 32, 1L, &real_opacity); } else xcb_delete_property(globalconf.connection, win, - x_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY")); + xutil_intern_atom(globalconf.connection, "_NET_WM_WINDOW_OPACITY")); } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80