JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removing Sylvain's patch because it breaks more than it fixes unfortunately, re-issui...
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index ac534a8..5df4919 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -41,7 +41,6 @@
 #endif /* XINERAMA */
 
 /* macros */
-#define D                       if(1)
 #define BUTTONMASK              (ButtonPressMask|ButtonReleaseMask)
 #define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask))
 #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH))
@@ -58,7 +57,7 @@
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
 enum { ColBorder, ColFG, ColBG, ColLast };              /* color */
-enum { NetSupported, NetWMName, NetLast };              /* EWMH atoms */
+enum { NetSupported, NetWMName, NetWMState, NetLast };  /* EWMH atoms */
 enum { WMProtocols, WMDelete, WMState, WMLast };        /* default atoms */
 enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
        ClkClientWin, ClkRootWin, ClkLast };             /* clicks */
@@ -1390,24 +1389,9 @@ restack(Monitor *m) {
 void
 run(void) {
        XEvent ev;
-       static const char *evname[LASTEvent] = {
-               [ButtonPress] = "buttonpress",
-               [ConfigureRequest] = "configurerequest",
-               [ConfigureNotify] = "configurenotify",
-               [DestroyNotify] = "destroynotify",
-               [EnterNotify] = "enternotify",
-               [Expose] = "expose",
-               [FocusIn] = "focusin",
-               [KeyPress] = "keypress",
-               [MappingNotify] = "mappingnotify",
-               [MapRequest] = "maprequest",
-               [PropertyNotify] = "propertynotify",
-               [UnmapNotify] = "unmapnotify"
-       };
        /* main event loop */
        XSync(dpy, False);
        while(running && !XNextEvent(dpy, &ev)) {
-               D fprintf(stderr, "run event %s %ld\n", evname[ev.type], ev.xany.window);
                if(handler[ev.type])
                        handler[ev.type](&ev); /* call handler */
        }
@@ -1510,6 +1494,7 @@ setup(void) {
        wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False);
        netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
        netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
+       netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False);
        /* init cursors */
        cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr);
        cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing);
@@ -2018,7 +2003,7 @@ zoom(const Arg *arg) {
 int
 main(int argc, char *argv[]) {
        if(argc == 2 && !strcmp("-v", argv[1]))
-               die("dwm-"VERSION", © 2006-2009 dwm engineers, see LICENSE for details\n");
+               die("dwm-"VERSION", © 2006-2010 dwm engineers, see LICENSE for details\n");
        else if(argc != 1)
                die("usage: dwm [-v]\n");
        if(!setlocale(LC_CTYPE, "") || !XSupportsLocale())