diff --git a/awesome.c b/awesome.c index dfe02be1a..875fe5645 100644 --- a/awesome.c +++ b/awesome.c @@ -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)) diff --git a/client.c b/client.c index 9d35aec20..0445e1051 100644 --- a/client.c +++ b/client.c @@ -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]); diff --git a/event.c b/event.c index c907a5b48..c42afaf83 100644 --- a/event.c +++ b/event.c @@ -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); } } } diff --git a/layout.c b/layout.c index ee5fcfae6..eb2b95558 100644 --- a/layout.c +++ b/layout.c @@ -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)); } diff --git a/statusbar.c b/statusbar.c index 46455265e..486dbd79a 100644 --- a/statusbar.c +++ b/statusbar.c @@ -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); } diff --git a/statusbar.h b/statusbar.h index 4e4060bcd..6924affa5 100644 --- a/statusbar.h +++ b/statusbar.h @@ -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 *);