diff --git a/src/drw.c b/src/drw.c index 8c84f76..b15c9f6 100644 --- a/src/drw.c +++ b/src/drw.c @@ -63,16 +63,16 @@ utf8decode(const char *c, long *u, size_t clen) } Drw * -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) +drw_create(Display *dpy, int screen, Window root, const struct Sizes sizes) { Drw *drw = ecalloc(1, sizeof(Drw)); drw->dpy = dpy; drw->screen = screen; drw->root = root; - drw->w = w; - drw->h = h; - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); + drw->w = sizes.w; + drw->h = sizes.h; + drw->drawable = XCreatePixmap(dpy, root, sizes.w, sizes.h, DefaultDepth(dpy, screen)); drw->gc = XCreateGC(dpy, root, 0, NULL); XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); diff --git a/src/drw.h b/src/drw.h index 4bcd5ad..75a9b04 100644 --- a/src/drw.h +++ b/src/drw.h @@ -1,4 +1,4 @@ -/* See LICENSE file for copyright and license details. */ +#include "state.h" typedef struct { Cursor cursor; @@ -27,7 +27,7 @@ typedef struct { } Drw; /* Drawable abstraction */ -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); +Drw *drw_create(Display *dpy, int screen, Window win, struct Sizes sizes); void drw_resize(Drw *drw, unsigned int w, unsigned int h); void drw_free(Drw *drw); diff --git a/src/dwm.c b/src/dwm.c index 1bf1611..d6725c5 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -283,8 +283,7 @@ int dwm_main(const char *const new_program_title) xbase->x_display, xbase->x_screen, xbase->x_root, - xbase->screen_sizes.w, - xbase->screen_sizes.h + xbase->screen_sizes ); if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))