setup() now take DC as arg
This commit is contained in:
parent
8fb0e0e73e
commit
e0994f834e
16
awesome.c
16
awesome.c
|
@ -129,7 +129,7 @@ Atom netatom[NetWMName];
|
||||||
* \todo clean things...
|
* \todo clean things...
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
setup(Display *disp, awesome_config *awesomeconf)
|
setup(Display *disp, DC *drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes wa;
|
XSetWindowAttributes wa;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ setup(Display *disp, awesome_config *awesomeconf)
|
||||||
grabkeys(disp, awesomeconf);
|
grabkeys(disp, awesomeconf);
|
||||||
compileregs(awesomeconf->rules, awesomeconf->nrules);
|
compileregs(awesomeconf->rules, awesomeconf->nrules);
|
||||||
/* bar */
|
/* bar */
|
||||||
dc.h = awesomeconf->statusbar.height = dc.font.height + 2;
|
drawcontext->h = awesomeconf->statusbar.height = drawcontext->font.height + 2;
|
||||||
wa.override_redirect = 1;
|
wa.override_redirect = 1;
|
||||||
wa.background_pixmap = ParentRelative;
|
wa.background_pixmap = ParentRelative;
|
||||||
wa.event_mask = ButtonPressMask | ExposureMask;
|
wa.event_mask = ButtonPressMask | ExposureMask;
|
||||||
|
@ -162,11 +162,11 @@ setup(Display *disp, awesome_config *awesomeconf)
|
||||||
updatebarpos(disp, awesomeconf->statusbar);
|
updatebarpos(disp, awesomeconf->statusbar);
|
||||||
XMapRaised(disp, awesomeconf->statusbar.window);
|
XMapRaised(disp, awesomeconf->statusbar.window);
|
||||||
/* pixmap for everything */
|
/* pixmap for everything */
|
||||||
dc.drawable = XCreatePixmap(disp, DefaultRootWindow(disp), DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, DefaultDepth(disp, DefaultScreen(disp)));
|
drawcontext->drawable = XCreatePixmap(disp, DefaultRootWindow(disp), DisplayWidth(disp, DefaultScreen(disp)), awesomeconf->statusbar.height, DefaultDepth(disp, DefaultScreen(disp)));
|
||||||
dc.gc = XCreateGC(disp, DefaultRootWindow(disp), 0, 0);
|
drawcontext->gc = XCreateGC(disp, DefaultRootWindow(disp), 0, 0);
|
||||||
XSetLineAttributes(disp, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(disp, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
if(!dc.font.set)
|
if(!drawcontext->font.set)
|
||||||
XSetFont(disp, dc.gc, dc.font.xfont->fid);
|
XSetFont(disp, drawcontext->gc, drawcontext->font.xfont->fid);
|
||||||
loadawesomeprops(disp, awesomeconf);
|
loadawesomeprops(disp, awesomeconf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ main(int argc, char *argv[])
|
||||||
xerrorxlib = XSetErrorHandler(xerror);
|
xerrorxlib = XSetErrorHandler(xerror);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
parse_config(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
parse_config(dpy, DefaultScreen(dpy), &dc, &awesomeconf);
|
||||||
setup(dpy, &awesomeconf);
|
setup(dpy, &dc, &awesomeconf);
|
||||||
drawstatus(dpy, &dc, &awesomeconf);
|
drawstatus(dpy, &dc, &awesomeconf);
|
||||||
scan(dpy, &awesomeconf);
|
scan(dpy, &awesomeconf);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
Loading…
Reference in New Issue