]> git.armaanb.net Git - dwm.git/blobdiff - dwm.c
All functions in alphabetical order except for this one.
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index b0d99c05ffed432638a943610625fa5adbbfb400..c98678d0cdd6ccfe87ebf53b7367b7d63534f8d0 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -56,7 +56,6 @@
 #define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
 #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
 #define TEXTW(X)                (drw_fontset_getwidth(drw, (X)) + lrpad)
-#define ColBorder               2
 
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -224,8 +223,8 @@ static void updateclientlist(void);
 static void updatenumlockmask(void);
 static void updatesizehints(Client *c);
 static void updatestatus(void);
-static void updatewindowtype(Client *c);
 static void updatetitle(Client *c);
+static void updatewindowtype(Client *c);
 static void updatewmhints(Client *c);
 static void view(const Arg *arg);
 static Client *wintoclient(Window w);
@@ -263,7 +262,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
 static Atom wmatom[WMLast], netatom[NetLast];
 static int running = 1;
 static Cur *cursor[CurLast];
-static Scm *scheme;
+static Clr **scheme;
 static Display *dpy;
 static Drw *drw;
 static Monitor *mons, *selmon;
@@ -910,8 +909,7 @@ gettextprop(Window w, Atom atom, char *text, unsigned int size)
        if (!text || size == 0)
                return 0;
        text[0] = '\0';
-       XGetTextProperty(dpy, w, &name, atom);
-       if (!name.nitems)
+       if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems)
                return 0;
        if (name.encoding == XA_STRING)
                strncpy(text, (char *)name.value, size - 1);
@@ -1569,7 +1567,7 @@ setup(void)
        cursor[CurResize] = drw_cur_create(drw, XC_sizing);
        cursor[CurMove] = drw_cur_create(drw, XC_fleur);
        /* init appearance */
-       scheme = ecalloc(LENGTH(colors), sizeof(Scm));
+       scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
        for (i = 0; i < LENGTH(colors); i++)
                scheme[i] = drw_scm_create(drw, colors[i], 3);
        /* init bars */
@@ -1580,7 +1578,7 @@ setup(void)
        XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32,
                PropModeReplace, (unsigned char *) &wmcheckwin, 1);
        XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8,
-               PropModeReplace, (unsigned char *) "dwm", 4);
+               PropModeReplace, (unsigned char *) "dwm", 3);
        XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32,
                PropModeReplace, (unsigned char *) &wmcheckwin, 1);
        /* EWMH support per view */
@@ -1986,6 +1984,14 @@ updatesizehints(Client *c)
        c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
 }
 
+void
+updatestatus(void)
+{
+       if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
+               strcpy(stext, "dwm-"VERSION);
+       drawbar(selmon);
+}
+
 void
 updatetitle(Client *c)
 {
@@ -1995,14 +2001,6 @@ updatetitle(Client *c)
                strcpy(c->name, broken);
 }
 
-void
-updatestatus(void)
-{
-       if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
-               strcpy(stext, "dwm-"VERSION);
-       drawbar(selmon);
-}
-
 void
 updatewindowtype(Client *c)
 {