From 894b341febc64cab6bfc5eba5e9dea010c7d4b92 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 24 Sep 2007 16:23:49 +0200 Subject: [PATCH] simplfiy drawstatus() remove screen useless arg --- awesome.c | 4 ++-- client.c | 2 +- event.c | 4 ++-- layout.c | 4 ++-- statusbar.c | 12 ++++++------ statusbar.h | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/awesome.c b/awesome.c index 00182076f..59ba712dc 100644 --- a/awesome.c +++ b/awesome.c @@ -321,7 +321,7 @@ main(int argc, char *argv[]) setup(dpy, screen, &dc[screen], &awesomeconf[screen]); XChangeProperty(dpy, RootWindow(dpy, screen), netatom[NetSupported], XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast); - drawstatusbar(dpy, screen, &dc[screen], &awesomeconf[screen]); + drawstatusbar(dpy, &dc[screen], &awesomeconf[screen]); } handler = p_new(event_handler *, LASTEvent); @@ -394,7 +394,7 @@ main(int argc, char *argv[]) if(p > awesomeconf[0].statustext) strncpy(awesomeconf[0].statustext, p + 1, sizeof(awesomeconf[0].statustext)); } - drawstatusbar(dpy, 0, &dc[0], &awesomeconf[0]); + drawstatusbar(dpy, &dc[0], &awesomeconf[0]); } while(XPending(dpy)) diff --git a/client.c b/client.c index 15f119d09..f0d817e41 100644 --- a/client.c +++ b/client.c @@ -277,7 +277,7 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config if(!selscreen) return; sel = c; - drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); + drawstatusbar(disp, drawcontext, awesomeconf); if(sel) { XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]); diff --git a/event.c b/event.c index 958d0e315..e4465862c 100644 --- a/event.c +++ b/event.c @@ -328,7 +328,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf) if(!ev->count) for(screen = 0; screen < ScreenCount(e->xany.display); screen++) if(awesomeconf[screen].statusbar.window == ev->window) - drawstatusbar(e->xany.display, screen, &dc[screen], &awesomeconf[screen]); + drawstatusbar(e->xany.display, &dc[screen], &awesomeconf[screen]); } void @@ -422,7 +422,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf) { updatetitle(c); if(c == sel) - drawstatusbar(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen]); + drawstatusbar(e->xany.display, &dc[c->screen], &awesomeconf[c->screen]); } } } diff --git a/layout.c b/layout.c index 1904d8311..fa3c955cf 100644 --- a/layout.c +++ b/layout.c @@ -115,7 +115,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf) XEvent ev; XWindowChanges wc; - drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); + drawstatusbar(disp, drawcontext, awesomeconf); if(!sel) return; if(sel->isfloating || IS_ARRANGE(layout_floating)) @@ -185,7 +185,7 @@ uicb_setlayout(Display *disp, if(sel) arrange(disp, drawcontext, awesomeconf); else - drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); + drawstatusbar(disp, drawcontext, awesomeconf); saveawesomeprops(disp, awesomeconf); diff --git a/statusbar.c b/statusbar.c index 1d54f103a..969b73cac 100644 --- a/statusbar.c +++ b/statusbar.c @@ -45,7 +45,7 @@ isoccupied(unsigned int t, int screen) } void -drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * awesomeconf) +drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf) { int x, i; drawcontext->x = drawcontext->y = 0; @@ -55,13 +55,13 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso if(awesomeconf->tags[i].selected) { drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i].name, drawcontext->sel); - if(isoccupied(i, screen)) + if(isoccupied(i, awesomeconf->screen)) drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->sel[ColFG]); } else { drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i].name, drawcontext->norm); - if(isoccupied(i, screen)) + if(isoccupied(i, awesomeconf->screen)) drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->norm[ColFG]); } drawcontext->x += drawcontext->w; @@ -70,11 +70,11 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->current_layout->symbol, drawcontext->norm); x = drawcontext->x + drawcontext->w; drawcontext->w = textw(drawcontext->font.set, drawcontext->font.xfont, awesomeconf->statustext, drawcontext->font.height); - drawcontext->x = DisplayWidth(disp, screen) - drawcontext->w; + drawcontext->x = DisplayWidth(disp, awesomeconf->screen) - drawcontext->w; if(drawcontext->x < x) { drawcontext->x = x; - drawcontext->w = DisplayWidth(disp, screen) - x; + drawcontext->w = DisplayWidth(disp, awesomeconf->screen) - x; } drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->statustext, drawcontext->norm); if((drawcontext->w = drawcontext->x - x) > awesomeconf->statusbar.height) @@ -89,7 +89,7 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso else drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm); } - XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, screen), awesomeconf->statusbar.height, 0, 0); + XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, awesomeconf->screen), awesomeconf->statusbar.height, 0, 0); XSync(disp, False); } diff --git a/statusbar.h b/statusbar.h index ac58ed10e..b2d8216fe 100644 --- a/statusbar.h +++ b/statusbar.h @@ -25,7 +25,7 @@ #include "common.h" void initstatusbar(Display *, int, DC *, Statusbar *); -void drawstatusbar(Display *, int, DC *, awesome_config *); +void drawstatusbar(Display *, DC *, awesome_config *); void updatebarpos(Display *, Statusbar); UICB_PROTO(uicb_togglebar);