From c4e130d7d92aae1e99ab03b2b49f5824f75f0cdf Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 11 Oct 2007 23:32:29 +0200 Subject: [PATCH] remove Display as param for uicb --- awesome.c | 4 +--- client.c | 29 +++++++++----------------- common.h | 2 +- config.h | 2 +- event.c | 38 +++++++++++++++++----------------- layout.c | 33 ++++++++++++----------------- layouts/tile.c | 15 ++++++-------- screen.c | 30 ++++++++++++--------------- statusbar.c | 7 +++---- tag.c | 56 ++++++++++++++++++-------------------------------- util.c | 16 +++++++-------- 11 files changed, 94 insertions(+), 138 deletions(-) diff --git a/awesome.c b/awesome.c index 6ec5efac..ea1fb937 100644 --- a/awesome.c +++ b/awesome.c @@ -209,14 +209,12 @@ xerrorstart(Display * disp __attribute__ ((unused)), XErrorEvent * ee __attribut } /** Quit awesome - * \param disp Display ref * \param awesomeconf awesome config * \param arg nothing * \ingroup ui_callback */ void -uicb_quit(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf __attribute__((unused)), +uicb_quit(awesome_config *awesomeconf __attribute__((unused)), const char *arg __attribute__ ((unused))) { readin = running = False; diff --git a/client.c b/client.c index c0dc20d1..2c71e77c 100644 --- a/client.c +++ b/client.c @@ -648,14 +648,12 @@ set_shape(Client *c) } /** Set selected client transparency - * \param disp Display ref * \param awesomeconf awesome config * \param arg unused arg * \ingroup ui_callback */ void -uicb_settrans(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf __attribute__ ((unused)), +uicb_settrans(awesome_config *awesomeconf __attribute__ ((unused)), const char *arg) { double delta = 100.0, current_opacity = 100.0; @@ -700,14 +698,12 @@ uicb_settrans(Display *disp __attribute__ ((unused)), /** Set borrder size - * \param disp Display ref * \param awesomeconf awesome config * \param arg X, +X or -X * \ingroup ui_callback */ void -uicb_setborder(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf, +uicb_setborder(awesome_config *awesomeconf, const char *arg) { if(!arg) @@ -718,8 +714,7 @@ uicb_setborder(Display *disp __attribute__ ((unused)), } void -uicb_swapnext(Display *disp, - awesome_config *awesomeconf, +uicb_swapnext(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { Client *next; @@ -731,13 +726,12 @@ uicb_swapnext(Display *disp, if(next) { client_swap(awesomeconf->clients, *awesomeconf->client_sel, next); - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } } void -uicb_swapprev(Display *disp, - awesome_config *awesomeconf, +uicb_swapprev(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { Client *prev; @@ -749,13 +743,12 @@ uicb_swapprev(Display *disp, if(prev) { client_swap(awesomeconf->clients, prev, *awesomeconf->client_sel); - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } } void -uicb_moveresize(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf, +uicb_moveresize(awesome_config *awesomeconf, const char *arg) { int nx, ny, nw, nh, ox, oy, ow, oh; @@ -790,14 +783,12 @@ uicb_moveresize(Display *disp __attribute__ ((unused)), } /** Kill selected client - * \param disp Display ref * \param awesomeconf awesome config * \param arg unused * \ingroup ui_callback */ void -uicb_killclient(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf __attribute__ ((unused)), +uicb_killclient(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { XEvent ev; @@ -808,9 +799,9 @@ uicb_killclient(Display *disp __attribute__ ((unused)), { ev.type = ClientMessage; ev.xclient.window = (*awesomeconf->client_sel)->win; - ev.xclient.message_type = XInternAtom(disp, "WM_PROTOCOLS", False); + ev.xclient.message_type = XInternAtom(awesomeconf->display, "WM_PROTOCOLS", False); ev.xclient.format = 32; - ev.xclient.data.l[0] = XInternAtom(disp, "WM_DELETE_WINDOW", False); + ev.xclient.data.l[0] = XInternAtom(awesomeconf->display, "WM_DELETE_WINDOW", False); ev.xclient.data.l[1] = CurrentTime; XSendEvent(awesomeconf->display, (*awesomeconf->client_sel)->win, False, NoEventMask, &ev); } diff --git a/common.h b/common.h index cb506988..cd8d3887 100644 --- a/common.h +++ b/common.h @@ -25,7 +25,7 @@ #include "config.h" /** Common prototype definition for ui_callbak functions */ -#define UICB_PROTO(name) void name(Display *, awesome_config *, const char *) +#define UICB_PROTO(name) void name(awesome_config *, const char *) /** Common prototype definition for layouts function */ #define LAYOUT_PROTO(name) void name(Display *, awesome_config *) diff --git a/config.h b/config.h index c6ea64fa..e1e0bcb1 100644 --- a/config.h +++ b/config.h @@ -56,7 +56,7 @@ typedef struct { unsigned long mod; KeySym keysym; - void (*func) (Display *, awesome_config *, char *); + void (*func) (awesome_config *, char *); char *arg; } Key; diff --git a/event.c b/event.c index f2b4e0c8..4737b9c9 100644 --- a/event.c +++ b/event.c @@ -165,33 +165,33 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) if(ev->button == Button1) { if(ev->state & awesomeconf[screen].modkey) - uicb_tag(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name); + uicb_tag(&awesomeconf[screen], awesomeconf[screen].tags[i].name); else - uicb_view(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name); + uicb_view(&awesomeconf[screen], awesomeconf[screen].tags[i].name); } else if(ev->button == Button3) { if(ev->state & awesomeconf[screen].modkey) - uicb_toggletag(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name); + uicb_toggletag(&awesomeconf[screen], awesomeconf[screen].tags[i].name); else - uicb_toggleview(e->xany.display, &awesomeconf[screen], awesomeconf[screen].tags[i].name); + uicb_toggleview(&awesomeconf[screen], awesomeconf[screen].tags[i].name); } else if(ev->button == Button4) - uicb_tag_viewnext(e->xany.display, &awesomeconf[screen], NULL); + uicb_tag_viewnext(&awesomeconf[screen], NULL); else if(ev->button == Button5) - uicb_tag_viewprev(e->xany.display, &awesomeconf[screen], NULL); + uicb_tag_viewprev(&awesomeconf[screen], NULL); return; } } x += awesomeconf[screen].statusbar.width; if(ev->x < x && (ev->button == Button1 || ev->button == Button4)) - uicb_setlayout(e->xany.display, &awesomeconf[screen], "+1"); + uicb_setlayout(&awesomeconf[screen], "+1"); else if(ev->x < x && (ev->button == Button3 || ev->button == Button5)) - uicb_setlayout(e->xany.display, &awesomeconf[screen], "-1"); + uicb_setlayout(&awesomeconf[screen], "-1"); else if(ev->button == Button4) - uicb_focusnext(e->xany.display, &awesomeconf[screen], NULL); + uicb_focusnext(&awesomeconf[screen], NULL); else if(ev->button == Button5) - uicb_focusprev(e->xany.display, &awesomeconf[screen], NULL); + uicb_focusprev(&awesomeconf[screen], NULL); return; } @@ -209,7 +209,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) else if(ev->button == Button1) { if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating) - uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL); + uicb_togglefloating(&awesomeconf[c->screen], NULL); else restack(e->xany.display, &awesomeconf[c->screen]); movemouse(c, awesomeconf); @@ -217,22 +217,22 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) else if(ev->button == Button2) { if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfixed && c->isfloating) - uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL); + uicb_togglefloating(&awesomeconf[c->screen], NULL); else - uicb_zoom(e->xany.display, &awesomeconf[c->screen], NULL); + uicb_zoom(&awesomeconf[c->screen], NULL); } else if(ev->button == Button3) { if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating) - uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL); + uicb_togglefloating(&awesomeconf[c->screen], NULL); else restack(e->xany.display, &awesomeconf[c->screen]); resizemouse(c, awesomeconf); } else if(ev->button == Button4) - uicb_settrans(e->xany.display, &awesomeconf[c->screen], "+5"); + uicb_settrans(&awesomeconf[c->screen], "+5"); else if(ev->button == Button5) - uicb_settrans(e->xany.display, &awesomeconf[c->screen], "-5"); + uicb_settrans(&awesomeconf[c->screen], "-5"); } else if(!*awesomeconf->client_sel) for(screen = 0; screen < ScreenCount(e->xany.display); screen++) @@ -241,9 +241,9 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) { screen = get_screen_bycoord(e->xany.display, x, y); if(ev->button == Button4) - uicb_tag_viewnext(e->xany.display, &awesomeconf[screen], NULL); + uicb_tag_viewnext(&awesomeconf[screen], NULL); else if(ev->button == Button5) - uicb_tag_viewprev(e->xany.display, &awesomeconf[screen], NULL); + uicb_tag_viewprev(&awesomeconf[screen], NULL); break; } } @@ -398,7 +398,7 @@ handle_event_keypress(XEvent * e, awesome_config *awesomeconf) for(i = 0; i < awesomeconf[screen].nkeys; i++) if(keysym == awesomeconf[screen].keys[i].keysym && CLEANMASK(awesomeconf[screen].keys[i].mod, screen) == CLEANMASK(ev->state, screen) && awesomeconf[screen].keys[i].func) - awesomeconf[screen].keys[i].func(e->xany.display, &awesomeconf[screen], awesomeconf[screen].keys[i].arg); + awesomeconf[screen].keys[i].func(&awesomeconf[screen], awesomeconf[screen].keys[i].arg); } void diff --git a/layout.c b/layout.c index e8b99399..9dc9330a 100644 --- a/layout.c +++ b/layout.c @@ -52,8 +52,7 @@ arrange(Display * disp, awesome_config *awesomeconf) } void -uicb_focusnext(Display *disp __attribute__ ((unused)), - awesome_config * awesomeconf, +uicb_focusnext(awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) { Client *c; @@ -71,8 +70,7 @@ uicb_focusnext(Display *disp __attribute__ ((unused)), } void -uicb_focusprev(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf, +uicb_focusprev(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { Client *c; @@ -165,8 +163,7 @@ saveawesomeprops(Display *disp, awesome_config *awesomeconf) } void -uicb_setlayout(Display *disp, - awesome_config * awesomeconf, +uicb_setlayout(awesome_config * awesomeconf, const char *arg) { int i; @@ -190,11 +187,11 @@ uicb_setlayout(Display *disp, c->ftview = True; if(*awesomeconf->client_sel) - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); else - drawstatusbar(disp, awesomeconf); + drawstatusbar(awesomeconf->display, awesomeconf); - saveawesomeprops(disp, awesomeconf); + saveawesomeprops(awesomeconf->display, awesomeconf); for(i = 0; i < awesomeconf->ntags; i++) if (awesomeconf->tags[i].selected) @@ -231,11 +228,10 @@ maximize(int x, int y, int w, int h, awesome_config *awesomeconf) } void -uicb_togglemax(Display *disp, - awesome_config *awesomeconf, +uicb_togglemax(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { - ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, &awesomeconf->statusbar); + ScreenInfo *si = get_screen_info(awesomeconf->display, awesomeconf->screen, &awesomeconf->statusbar); maximize(si[awesomeconf->screen].x_org, si[awesomeconf->screen].y_org, si[awesomeconf->screen].width - 2 * awesomeconf->borderpx, @@ -245,11 +241,10 @@ uicb_togglemax(Display *disp, } void -uicb_toggleverticalmax(Display *disp, - awesome_config *awesomeconf, +uicb_toggleverticalmax(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { - ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, &awesomeconf->statusbar); + ScreenInfo *si = get_screen_info(awesomeconf->display, awesomeconf->screen, &awesomeconf->statusbar); if(*awesomeconf->client_sel) maximize((*awesomeconf->client_sel)->x, @@ -262,11 +257,10 @@ uicb_toggleverticalmax(Display *disp, void -uicb_togglehorizontalmax(Display *disp, - awesome_config *awesomeconf, +uicb_togglehorizontalmax(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { - ScreenInfo *si = get_screen_info(disp, awesomeconf->screen, &awesomeconf->statusbar); + ScreenInfo *si = get_screen_info(awesomeconf->display, awesomeconf->screen, &awesomeconf->statusbar); if(*awesomeconf->client_sel) maximize(si[awesomeconf->screen].x_org, @@ -278,8 +272,7 @@ uicb_togglehorizontalmax(Display *disp, } void -uicb_zoom(Display *disp __attribute__ ((unused)), - awesome_config *awesomeconf, +uicb_zoom(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { if(!*awesomeconf->client_sel) diff --git a/layouts/tile.c b/layouts/tile.c index 97d7d389..1d4b5cfe 100644 --- a/layouts/tile.c +++ b/layouts/tile.c @@ -29,8 +29,7 @@ #include "layouts/tile.h" void -uicb_setnmaster(Display *disp, - awesome_config *awesomeconf, +uicb_setnmaster(awesome_config *awesomeconf, const char * arg) { if(!arg || (!IS_ARRANGE(0, layout_tile) && !IS_ARRANGE(0, layout_tileleft))) @@ -40,12 +39,11 @@ uicb_setnmaster(Display *disp, if((awesomeconf->nmaster = (int) compute_new_value_from_arg(arg, (double) awesomeconf->nmaster)) < 0) awesomeconf->nmaster = 0; - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } void -uicb_setncol(Display *disp, - awesome_config *awesomeconf, +uicb_setncol(awesome_config *awesomeconf, const char * arg) { if(!arg || (!IS_ARRANGE(0, layout_tile) && !IS_ARRANGE(0, layout_tileleft))) @@ -54,12 +52,11 @@ uicb_setncol(Display *disp, if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1) awesomeconf->ncol = 1; - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } void -uicb_setmwfact(Display *disp, - awesome_config * awesomeconf, +uicb_setmwfact(awesome_config * awesomeconf, const char *arg) { char *newarg; @@ -81,7 +78,7 @@ uicb_setmwfact(Display *disp, else if(awesomeconf->mwfact > 0.9) awesomeconf->mwfact = 0.9; - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); p_delete(&newarg); } diff --git a/screen.c b/screen.c index b81f85ed..e79c998c 100644 --- a/screen.c +++ b/screen.c @@ -188,12 +188,11 @@ move_mouse_pointer_to_screen(Display *disp, int screen) } void -uicb_focusnextscreen(Display *disp, - awesome_config * awesomeconf, +uicb_focusnextscreen(awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) { Client *c; - int next_screen = awesomeconf->screen + 1 >= get_screen_count(disp) ? 0 : awesomeconf->screen + 1; + int next_screen = awesomeconf->screen + 1 >= get_screen_count(awesomeconf->display) ? 0 : awesomeconf->screen + 1; for(c = *awesomeconf->clients; c && !isvisible(c, next_screen, awesomeconf[next_screen - awesomeconf->screen].tags, awesomeconf[next_screen - awesomeconf->screen].ntags); c = c->next); if(c) @@ -201,16 +200,15 @@ uicb_focusnextscreen(Display *disp, focus(c->display, c, True, &awesomeconf[next_screen - awesomeconf->screen]); restack(c->display, &awesomeconf[next_screen - awesomeconf->screen]); } - move_mouse_pointer_to_screen(disp, next_screen); + move_mouse_pointer_to_screen(awesomeconf->display, next_screen); } void -uicb_focusprevscreen(Display *disp, - awesome_config * awesomeconf, +uicb_focusprevscreen(awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) { Client *c; - int prev_screen = awesomeconf->screen - 1 < 0 ? get_screen_count(disp) - 1 : awesomeconf->screen - 1; + int prev_screen = awesomeconf->screen - 1 < 0 ? get_screen_count(awesomeconf->display) - 1 : awesomeconf->screen - 1; for(c = *awesomeconf->clients; c && !isvisible(c, prev_screen, awesomeconf[prev_screen - awesomeconf->screen].tags, awesomeconf[prev_screen - awesomeconf->screen].ntags); c = c->next); if(c) @@ -218,23 +216,21 @@ uicb_focusprevscreen(Display *disp, focus(c->display, c, True, &awesomeconf[prev_screen - awesomeconf->screen]); restack(c->display, &awesomeconf[prev_screen - awesomeconf->screen]); } - move_mouse_pointer_to_screen(disp, prev_screen); + move_mouse_pointer_to_screen(awesomeconf->display, prev_screen); } /** Move client to a virtual screen (if Xinerama is active) - * \param disp Display ref * \param awesomeconf awesome config * \param arg screen number * \ingroup ui_callback */ void -uicb_movetoscreen(Display *disp, - awesome_config * awesomeconf, +uicb_movetoscreen(awesome_config * awesomeconf, const char *arg) { int new_screen, prev_screen; - if(!*awesomeconf->client_sel || !XineramaIsActive(disp)) + if(!*awesomeconf->client_sel || !XineramaIsActive(awesomeconf->display)) return; if(arg) @@ -242,14 +238,14 @@ uicb_movetoscreen(Display *disp, else new_screen = (*awesomeconf->client_sel)->screen + 1; - if(new_screen >= get_screen_count(disp)) + if(new_screen >= get_screen_count(awesomeconf->display)) new_screen = 0; else if(new_screen < 0) - new_screen = get_screen_count(disp) - 1; + new_screen = get_screen_count(awesomeconf->display) - 1; prev_screen = (*awesomeconf->client_sel)->screen; move_client_to_screen(*awesomeconf->client_sel, &awesomeconf[new_screen - awesomeconf->screen], True); - move_mouse_pointer_to_screen(disp, new_screen); - arrange(disp, &awesomeconf[prev_screen - awesomeconf->screen]); - arrange(disp, &awesomeconf[new_screen - awesomeconf->screen]); + move_mouse_pointer_to_screen(awesomeconf->display, new_screen); + arrange(awesomeconf->display, &awesomeconf[prev_screen - awesomeconf->screen]); + arrange(awesomeconf->display, &awesomeconf[new_screen - awesomeconf->screen]); } diff --git a/statusbar.c b/statusbar.c index 0b128b5f..806ebb32 100644 --- a/statusbar.c +++ b/statusbar.c @@ -237,15 +237,14 @@ updatebarpos(Display *disp, Statusbar statusbar) } void -uicb_togglebar(Display *disp, - awesome_config *awesomeconf, +uicb_togglebar(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { if(awesomeconf->statusbar.position == BarOff) awesomeconf->statusbar.position = (awesomeconf->statusbar_default_position == BarOff) ? BarTop : awesomeconf->statusbar_default_position; else awesomeconf->statusbar.position = BarOff; - updatebarpos(disp, awesomeconf->statusbar); - arrange(disp, awesomeconf); + updatebarpos(awesomeconf->display, awesomeconf->statusbar); + arrange(awesomeconf->display, awesomeconf); } diff --git a/tag.c b/tag.c index f5b04c80..629ecb32 100644 --- a/tag.c +++ b/tag.c @@ -151,13 +151,11 @@ isvisible(Client * c, int screen, Tag * tags, int ntags) /** Tag selected window with tag - * \param disp Display ref * \param arg Tag name * \ingroup ui_callback */ void -uicb_tag(Display *disp, - awesome_config *awesomeconf, +uicb_tag(awesome_config *awesomeconf, const char *arg) { int i; @@ -170,17 +168,15 @@ uicb_tag(Display *disp, if(i >= 0 && i < awesomeconf->ntags) (*awesomeconf->client_sel)->tags[i] = True; saveprops(*awesomeconf->client_sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** Toggle floating state of a client - * \param disp Display ref * \param arg unused * \ingroup ui_callback */ void -uicb_togglefloating(Display *disp, - awesome_config * awesomeconf, +uicb_togglefloating(awesome_config * awesomeconf, const char *arg __attribute__ ((unused))) { if(!*awesomeconf->client_sel) @@ -203,17 +199,15 @@ uicb_togglefloating(Display *disp, (*awesomeconf->client_sel)->rh = (*awesomeconf->client_sel)->h; } saveprops(*awesomeconf->client_sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** Toggle tag view - * \param disp Display ref * \param arg Tag name * \ingroup ui_callback */ void -uicb_toggletag(Display *disp, - awesome_config *awesomeconf, +uicb_toggletag(awesome_config *awesomeconf, const char *arg) { unsigned int i; @@ -227,17 +221,15 @@ uicb_toggletag(Display *disp, if(j == awesomeconf->ntags) (*awesomeconf->client_sel)->tags[i] = True; saveprops(*awesomeconf->client_sel, awesomeconf->ntags); - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** Add a tag to viewed tags - * \param disp Display ref * \param arg Tag name * \ingroup ui_callback */ void -uicb_toggleview(Display *disp, - awesome_config *awesomeconf, +uicb_toggleview(awesome_config *awesomeconf, const char *arg) { unsigned int i; @@ -248,19 +240,17 @@ uicb_toggleview(Display *disp, for(j = 0; j < awesomeconf->ntags && !awesomeconf->tags[j].selected; j++); if(j == awesomeconf->ntags) awesomeconf->tags[i].selected = True; - saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + saveawesomeprops(awesomeconf->display, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** View tag - * \param disp Display ref * \param awesomeconf awesome config ref * \param arg tag to view * \ingroup ui_callback */ void -uicb_view(Display *disp, - awesome_config *awesomeconf, +uicb_view(awesome_config *awesomeconf, const char *arg) { int i; @@ -276,19 +266,17 @@ uicb_view(Display *disp, awesomeconf->tags[i].selected = True; awesomeconf->current_layout = awesomeconf->tags[i].layout; } - saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + saveawesomeprops(awesomeconf->display, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** View previously selected tags - * \param disp Display ref * \param awesomeconf awesome config ref * \param arg unused * \ingroup ui_callback */ void -uicb_tag_prev_selected(Display * disp, - awesome_config *awesomeconf, +uicb_tag_prev_selected(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { int i; @@ -300,17 +288,15 @@ uicb_tag_prev_selected(Display * disp, awesomeconf->tags[i].selected = awesomeconf->tags[i].was_selected; awesomeconf->tags[i].was_selected = t; } - arrange(disp, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** View next tag - * \param disp Display ref * \param arg unused * \ingroup ui_callback */ void -uicb_tag_viewnext(Display *disp, - awesome_config *awesomeconf, +uicb_tag_viewnext(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { int i; @@ -326,18 +312,16 @@ uicb_tag_viewnext(Display *disp, firsttag = 0; awesomeconf->tags[firsttag].selected = True; awesomeconf->current_layout = awesomeconf->tags[firsttag].layout; - saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + saveawesomeprops(awesomeconf->display, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } /** View previous tag - * \param disp Display ref * \param arg unused * \ingroup ui_callback */ void -uicb_tag_viewprev(Display *disp, - awesome_config *awesomeconf, +uicb_tag_viewprev(awesome_config *awesomeconf, const char *arg __attribute__ ((unused))) { int i; @@ -353,6 +337,6 @@ uicb_tag_viewprev(Display *disp, firsttag = awesomeconf->ntags - 1; awesomeconf->tags[firsttag].selected = True; awesomeconf->current_layout = awesomeconf->tags[firsttag].layout; - saveawesomeprops(disp, awesomeconf); - arrange(disp, awesomeconf); + saveawesomeprops(awesomeconf->display, awesomeconf); + arrange(awesomeconf->display, awesomeconf); } diff --git a/util.c b/util.c index c86813a4..0e1a5cbb 100644 --- a/util.c +++ b/util.c @@ -55,21 +55,19 @@ eprint(const char *fmt, ...) } void -uicb_exec(Display * disp, - awesome_config * awesomeconf __attribute__ ((unused)), +uicb_exec(awesome_config * awesomeconf, const char *arg) { char path[PATH_MAX]; - if(disp) - close(ConnectionNumber(disp)); + if(awesomeconf->display) + close(ConnectionNumber(awesomeconf->display)); sscanf(arg, "%s", path); execlp(path, arg, NULL); } void -uicb_spawn(Display * disp, - awesome_config * awesomeconf __attribute__ ((unused)), +uicb_spawn(awesome_config * awesomeconf, const char *arg) { static char *shell = NULL; @@ -81,7 +79,7 @@ uicb_spawn(Display * disp, if(!arg) return; - if(!XineramaIsActive(disp) && (tmp = getenv("DISPLAY"))) + if(!XineramaIsActive(awesomeconf->display) && (tmp = getenv("DISPLAY"))) { display = a_strdup(tmp); if((tmp = strrchr(display, '.'))) @@ -97,8 +95,8 @@ uicb_spawn(Display * disp, { if(fork() == 0) { - if(disp) - close(ConnectionNumber(disp)); + if(awesomeconf->display) + close(ConnectionNumber(awesomeconf->display)); setsid(); execl(shell, shell, "-c", arg, (char *) NULL); fprintf(stderr, "awesome: execl '%s -c %s'", shell, arg);