add screen to drawstatusbar

This commit is contained in:
Julien Danjou 2007-09-15 22:57:37 +02:00
parent 3cc29b0250
commit 53e5630c6c
6 changed files with 13 additions and 13 deletions

View File

@ -273,7 +273,7 @@ main(int argc, char *argv[])
XSync(dpy, False);
parse_config(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
setup(dpy, &dc, &awesomeconf);
drawstatusbar(dpy, &dc, &awesomeconf);
drawstatusbar(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
void (*handler[LASTEvent]) (XEvent *, awesome_config *) =
{
@ -335,7 +335,7 @@ main(int argc, char *argv[])
if(p > awesomeconf.statustext)
strncpy(awesomeconf.statustext, p + 1, sizeof(awesomeconf.statustext));
}
drawstatusbar(dpy, &dc, &awesomeconf);
drawstatusbar(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
}
while(XPending(dpy))

View File

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

View File

@ -304,7 +304,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
XExposeEvent *ev = &e->xexpose;
if(!ev->count && awesomeconf->statusbar.window == ev->window)
drawstatusbar(e->xany.display, &dc, awesomeconf);
drawstatusbar(e->xany.display, DefaultScreen(e->xany.display), &dc, awesomeconf);
}
void
@ -380,7 +380,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
{
updatetitle(c);
if(c == sel)
drawstatusbar(e->xany.display, &dc, awesomeconf);
drawstatusbar(e->xany.display, c->screen, &dc, awesomeconf);
}
}
}

View File

@ -112,7 +112,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
XEvent ev;
XWindowChanges wc;
drawstatusbar(disp, drawcontext, awesomeconf);
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
if(!sel)
return;
if(sel->isfloating || IS_ARRANGE(floating))
@ -182,7 +182,7 @@ uicb_setlayout(Display *disp,
if(sel)
arrange(disp, drawcontext, awesomeconf);
else
drawstatusbar(disp, drawcontext, awesomeconf);
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
saveawesomeprops(disp, DefaultScreen(disp), awesomeconf);
@ -214,7 +214,7 @@ maximize(int x, int y, int w, int h, DC *drawcontext, awesome_config *awesomecon
else
sel->isfloating = False;
drawstatusbar(sel->display, drawcontext, awesomeconf);
drawstatusbar(sel->display, sel->screen, drawcontext, awesomeconf);
while(XCheckMaskEvent(sel->display, EnterWindowMask, &ev));
}

View File

@ -43,7 +43,7 @@ isoccupied(unsigned int t)
}
void
drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * awesomeconf)
{
int x, i;
drawcontext->x = drawcontext->y = 0;
@ -66,11 +66,11 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
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, DefaultScreen(disp)) - drawcontext->w;
drawcontext->x = DisplayWidth(disp, screen) - drawcontext->w;
if(drawcontext->x < x)
{
drawcontext->x = x;
drawcontext->w = DisplayWidth(disp, DefaultScreen(disp)) - x;
drawcontext->w = DisplayWidth(disp, screen) - x;
}
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, awesomeconf->statustext, drawcontext->norm);
if((drawcontext->w = drawcontext->x - x) > awesomeconf->statusbar.height)
@ -84,7 +84,7 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
else
drawtext(disp, *drawcontext, awesomeconf->statusbar.drawable, NULL, drawcontext->norm);
}
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, 0, 0);
XCopyArea(disp, awesomeconf->statusbar.drawable, awesomeconf->statusbar.window, drawcontext->gc, 0, 0, DisplayWidth(disp, screen), awesomeconf->statusbar.height, 0, 0);
XSync(disp, False);
}

View File

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