X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=17d5218cda906940f555b37f02043546dfd48353;hp=267659f3835c9da586a022f170280e4229beaa80;hb=1724f7fa43f9b2a3a3479c365e685ba23327ce2c;hpb=61c3095f2f9b35a0b330b37c172daefae0278663 diff --git a/dwm.c b/dwm.c index 267659f..17d5218 100644 --- a/dwm.c +++ b/dwm.c @@ -66,7 +66,7 @@ typedef union { int i; unsigned int ui; float f; - void *v; + const void *v; } Arg; typedef struct { @@ -136,7 +136,7 @@ struct Monitor { Client *stack; Monitor *next; Window barwin; - Layout *lt[2]; + const Layout *lt[2]; }; typedef struct { @@ -177,7 +177,7 @@ static void focusin(XEvent *e); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); static unsigned long getcolor(const char *colstr); -static Bool getrootpointer(int *x, int *y); +static Bool getrootptr(int *x, int *y); static long getstate(Window w); static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, Bool focused); @@ -192,7 +192,7 @@ static void maprequest(XEvent *e); static void monocle(Monitor *m); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); -static Monitor *pointertomon(int x, int y); +static Monitor *ptrtomon(int x, int y); static void propertynotify(XEvent *e); static void quit(const Arg *arg); static void resize(Client *c, int x, int y, int w, int h, Bool interact); @@ -275,7 +275,7 @@ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 void applyrules(Client *c) { unsigned int i; - Rule *r; + const Rule *r; XClassHint ch = { 0 }; /* rule matching */ @@ -862,7 +862,7 @@ getcolor(const char *colstr) { } Bool -getrootpointer(int *x, int *y) { +getrootptr(int *x, int *y) { int di; unsigned int dui; Window dummy; @@ -1147,7 +1147,7 @@ movemouse(const Arg *arg) { if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, cursor[CurMove], CurrentTime) != GrabSuccess) return; - if(!getrootpointer(&x, &y)) + if(!getrootptr(&x, &y)) return; do { XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); @@ -1181,7 +1181,7 @@ movemouse(const Arg *arg) { } while(ev.type != ButtonRelease); XUngrabPointer(dpy, CurrentTime); - if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { + if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { sendmon(c, m); selmon = m; focus(NULL); @@ -1195,7 +1195,7 @@ nexttiled(Client *c) { } Monitor * -pointertomon(int x, int y) { +ptrtomon(int x, int y) { Monitor *m; for(m = mons; m; m = m->next) @@ -1302,7 +1302,7 @@ resizemouse(const Arg *arg) { XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); XUngrabPointer(dpy, CurrentTime); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if((m = pointertomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { + if((m = ptrtomon(c->x + c->w / 2, c->y + c->h / 2)) != selmon) { sendmon(c, m); selmon = m; focus(NULL); @@ -1339,10 +1339,9 @@ run(void) { /* main event loop */ XSync(dpy, False); - while(running && !XNextEvent(dpy, &ev)) { + while(running && !XNextEvent(dpy, &ev)) if(handler[ev.type]) (handler[ev.type])(&ev); /* call handler */ - } } void @@ -1727,8 +1726,8 @@ updategeom(void) { m->sellt = 0; m->tagset[0] = m->tagset[1] = 1; m->mfact = mfact; - m->showbar = SHOWBAR; - m->topbar = TOPBAR; + m->showbar = showbar; + m->topbar = topbar; m->lt[0] = &layouts[0]; m->lt[1] = &layouts[1 % LENGTH(layouts)]; updatebarpos(m); @@ -1870,8 +1869,8 @@ wintomon(Window w) { Client *c; Monitor *m; - if(w == root && getrootpointer(&x, &y)) - return pointertomon(x, y); + if(w == root && getrootptr(&x, &y)) + return ptrtomon(x, y); for(m = mons; m; m = m->next) if(w == m->barwin) return m;