add screen to drawstatusbar
This commit is contained in:
parent
3cc29b0250
commit
53e5630c6c
|
@ -273,7 +273,7 @@ main(int argc, char *argv[])
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
parse_config(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
parse_config(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
||||||
setup(dpy, &dc, &awesomeconf);
|
setup(dpy, &dc, &awesomeconf);
|
||||||
drawstatusbar(dpy, &dc, &awesomeconf);
|
drawstatusbar(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
||||||
|
|
||||||
void (*handler[LASTEvent]) (XEvent *, awesome_config *) =
|
void (*handler[LASTEvent]) (XEvent *, awesome_config *) =
|
||||||
{
|
{
|
||||||
|
@ -335,7 +335,7 @@ main(int argc, char *argv[])
|
||||||
if(p > awesomeconf.statustext)
|
if(p > awesomeconf.statustext)
|
||||||
strncpy(awesomeconf.statustext, p + 1, sizeof(awesomeconf.statustext));
|
strncpy(awesomeconf.statustext, p + 1, sizeof(awesomeconf.statustext));
|
||||||
}
|
}
|
||||||
drawstatusbar(dpy, &dc, &awesomeconf);
|
drawstatusbar(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(XPending(dpy))
|
while(XPending(dpy))
|
||||||
|
|
2
client.c
2
client.c
|
@ -279,7 +279,7 @@ focus(Display *disp, int screen, DC *drawcontext, Client * c, Bool selscreen, aw
|
||||||
if(!selscreen)
|
if(!selscreen)
|
||||||
return;
|
return;
|
||||||
sel = c;
|
sel = c;
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, screen, drawcontext, awesomeconf);
|
||||||
if(sel)
|
if(sel)
|
||||||
{
|
{
|
||||||
XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]);
|
XSetWindowBorder(sel->display, sel->win, drawcontext->sel[ColBorder]);
|
||||||
|
|
4
event.c
4
event.c
|
@ -304,7 +304,7 @@ handle_event_expose(XEvent * e, awesome_config *awesomeconf)
|
||||||
XExposeEvent *ev = &e->xexpose;
|
XExposeEvent *ev = &e->xexpose;
|
||||||
|
|
||||||
if(!ev->count && awesomeconf->statusbar.window == ev->window)
|
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
|
void
|
||||||
|
@ -380,7 +380,7 @@ handle_event_propertynotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
if(c == sel)
|
if(c == sel)
|
||||||
drawstatusbar(e->xany.display, &dc, awesomeconf);
|
drawstatusbar(e->xany.display, c->screen, &dc, awesomeconf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
layout.c
6
layout.c
|
@ -112,7 +112,7 @@ restack(Display * disp, DC * drawcontext, awesome_config *awesomeconf)
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
if(sel->isfloating || IS_ARRANGE(floating))
|
if(sel->isfloating || IS_ARRANGE(floating))
|
||||||
|
@ -182,7 +182,7 @@ uicb_setlayout(Display *disp,
|
||||||
if(sel)
|
if(sel)
|
||||||
arrange(disp, drawcontext, awesomeconf);
|
arrange(disp, drawcontext, awesomeconf);
|
||||||
else
|
else
|
||||||
drawstatusbar(disp, drawcontext, awesomeconf);
|
drawstatusbar(disp, DefaultScreen(disp), drawcontext, awesomeconf);
|
||||||
|
|
||||||
saveawesomeprops(disp, DefaultScreen(disp), 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
|
else
|
||||||
sel->isfloating = False;
|
sel->isfloating = False;
|
||||||
|
|
||||||
drawstatusbar(sel->display, drawcontext, awesomeconf);
|
drawstatusbar(sel->display, sel->screen, drawcontext, awesomeconf);
|
||||||
|
|
||||||
while(XCheckMaskEvent(sel->display, EnterWindowMask, &ev));
|
while(XCheckMaskEvent(sel->display, EnterWindowMask, &ev));
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ isoccupied(unsigned int t)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
|
drawstatusbar(Display *disp, int screen, DC *drawcontext, awesome_config * awesomeconf)
|
||||||
{
|
{
|
||||||
int x, i;
|
int x, i;
|
||||||
drawcontext->x = drawcontext->y = 0;
|
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);
|
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, DefaultScreen(disp)) - drawcontext->w;
|
drawcontext->x = DisplayWidth(disp, screen) - drawcontext->w;
|
||||||
if(drawcontext->x < x)
|
if(drawcontext->x < x)
|
||||||
{
|
{
|
||||||
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);
|
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)
|
||||||
|
@ -84,7 +84,7 @@ drawstatusbar(Display *disp, DC *drawcontext, awesome_config * awesomeconf)
|
||||||
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, 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);
|
XSync(disp, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
void initstatusbar(Display *, int, DC *, Statusbar *);
|
void initstatusbar(Display *, int, DC *, Statusbar *);
|
||||||
void drawstatusbar(Display *, DC *, awesome_config *);
|
void drawstatusbar(Display *, int, DC *, awesome_config *);
|
||||||
void updatebarpos(Display *, Statusbar);
|
void updatebarpos(Display *, Statusbar);
|
||||||
void uicb_togglebar(Display *, DC *, awesome_config *, const char *);
|
void uicb_togglebar(Display *, DC *, awesome_config *, const char *);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue