simplfiy drawstatus() remove screen useless arg

This commit is contained in:
Julien Danjou 2007-09-24 16:23:49 +02:00
parent c5c810a285
commit 894b341feb
6 changed files with 14 additions and 14 deletions

View File

@ -321,7 +321,7 @@ main(int argc, char *argv[])
setup(dpy, screen, &dc[screen], &awesomeconf[screen]); setup(dpy, screen, &dc[screen], &awesomeconf[screen]);
XChangeProperty(dpy, RootWindow(dpy, screen), netatom[NetSupported], XChangeProperty(dpy, RootWindow(dpy, screen), netatom[NetSupported],
XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast); 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); handler = p_new(event_handler *, LASTEvent);
@ -394,7 +394,7 @@ main(int argc, char *argv[])
if(p > awesomeconf[0].statustext) if(p > awesomeconf[0].statustext)
strncpy(awesomeconf[0].statustext, p + 1, sizeof(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)) while(XPending(dpy))

View File

@ -277,7 +277,7 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config
if(!selscreen) if(!selscreen)
return; return;
sel = c; sel = c;
drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); drawstatusbar(disp, drawcontext, awesomeconf);
if(sel) if(sel)
{ {
XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]); XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]);

View File

@ -328,7 +328,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
if(!ev->count) if(!ev->count)
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
if(awesomeconf[screen].statusbar.window == ev->window) 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 void
@ -422,7 +422,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
{ {
updatetitle(c); updatetitle(c);
if(c == sel) 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]);
} }
} }
} }

View File

@ -115,7 +115,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
XEvent ev; XEvent ev;
XWindowChanges wc; XWindowChanges wc;
drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); drawstatusbar(disp, drawcontext, awesomeconf);
if(!sel) if(!sel)
return; return;
if(sel->isfloating || IS_ARRANGE(layout_floating)) if(sel->isfloating || IS_ARRANGE(layout_floating))
@ -185,7 +185,7 @@ uicb_setlayout(Display *disp,
if(sel) if(sel)
arrange(disp, drawcontext, awesomeconf); arrange(disp, drawcontext, awesomeconf);
else else
drawstatusbar(disp, awesomeconf->screen, drawcontext, awesomeconf); drawstatusbar(disp, drawcontext, awesomeconf);
saveawesomeprops(disp, awesomeconf); saveawesomeprops(disp, awesomeconf);

View File

@ -45,7 +45,7 @@ isoccupied(unsigned int t, int screen)
} }
void void
drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * awesomeconf) drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
{ {
int x, i; int x, i;
drawcontext->x = drawcontext->y = 0; drawcontext->x = drawcontext->y = 0;
@ -55,13 +55,13 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso
if(awesomeconf->tags[i].selected) if(awesomeconf->tags[i].selected)
{ {
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i].name, drawcontext->sel); 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]); drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->sel[ColFG]);
} }
else else
{ {
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->tags[i].name, drawcontext->norm); 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]); drawsquare(disp, *drawcontext, awesomeconf->statusbar.drawable, sel && sel->tags[i], drawcontext->norm[ColFG]);
} }
drawcontext->x += drawcontext->w; 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); drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->current_layout->symbol, drawcontext->norm);
x = drawcontext->x + drawcontext->w; x = drawcontext->x + drawcontext->w;
drawcontext->w = textw(drawcontext->font.set, drawcontext->font.xfont, awesomeconf->statustext, drawcontext->font.height); 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) if(drawcontext->x < x)
{ {
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); drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->statustext, drawcontext->norm);
if((drawcontext->w = drawcontext->x - x) > awesomeconf->statusbar.height) if((drawcontext->w = drawcontext->x - x) > awesomeconf->statusbar.height)
@ -89,7 +89,7 @@ drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * aweso
else else
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm); 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); XSync(disp, False);
} }

View File

@ -25,7 +25,7 @@
#include "common.h" #include "common.h"
void initstatusbar(Display *, int, DC *, Statusbar *); void initstatusbar(Display *, int, DC *, Statusbar *);
void drawstatusbar(Display *, int, DC *, awesome_config *); void drawstatusbar(Display *, DC *, awesome_config *);
void updatebarpos(Display *, Statusbar); void updatebarpos(Display *, Statusbar);
UICB_PROTO(uicb_togglebar); UICB_PROTO(uicb_togglebar);