JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied Jeroen Schot's shiftview patch
[dwm.git] / event.c
diff --git a/event.c b/event.c
index 1da9a6b..ac96df1 100644 (file)
--- a/event.c
+++ b/event.c
@@ -135,6 +135,10 @@ buttonpress(XEvent *e) {
                                        else
                                                toggleview(buf);
                                }
+                               else if(ev->button == Button4)
+                                       shiftview("-1");
+                               else if(ev->button == Button5)
+                                       shiftview("1");
                                return;
                        }
                }
@@ -144,6 +148,10 @@ buttonpress(XEvent *e) {
                                setlayout(NULL);
                                break;
                        }
+               else if(ev->button == Button4)
+                       focusclient("-1");
+               else if(ev->button == Button5)
+                       focusclient("1");
        }
        else if((c = getclient(ev->window))) {
                focus(c);
@@ -225,19 +233,6 @@ configurenotify(XEvent *e) {
 }
 
 static void
-createnotify(XEvent *e) {
-       static XWindowAttributes wa;
-       XCreateWindowEvent *ev = &e->xcreatewindow;
-
-       if(!XGetWindowAttributes(dpy, ev->window, &wa))
-               return;
-       if(wa.override_redirect)
-               return;
-       if(!getclient(ev->window) && (wa.map_state == IsViewable))
-               manage(ev->window, &wa);
-}
-
-static void
 destroynotify(XEvent *e) {
        Client *c;
        XDestroyWindowEvent *ev = &e->xdestroywindow;
@@ -363,7 +358,6 @@ void (*handler[LASTEvent]) (XEvent *) = {
        [ButtonPress] = buttonpress,
        [ConfigureRequest] = configurerequest,
        [ConfigureNotify] = configurenotify,
-/*     [CreateNotify] = createnotify, */
        [DestroyNotify] = destroynotify,
        [EnterNotify] = enternotify,
        [LeaveNotify] = leavenotify,