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]);
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))

View File

@ -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]);

View File

@ -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]);
}
}
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);