JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied Sanders patches
[dwm.git] / event.c
diff --git a/event.c b/event.c
index 58df281..17be71d 100644 (file)
--- a/event.c
+++ b/event.c
@@ -8,9 +8,6 @@
 #include <X11/keysym.h>
 #include <X11/Xatom.h>
 
-#define ButtonMask      (ButtonPressMask | ButtonReleaseMask)
-#define MouseMask       (ButtonMask | PointerMotionMask)
-
 /* CUSTOMIZE */
 
 typedef struct {
@@ -22,8 +19,8 @@ typedef struct {
 
 const char *browse[] = { "firefox", NULL };
 const char *gimp[] = { "gimp", NULL };
-const char *term[] = { 
-       "urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
+const char *term[] = { /*"xterm", NULL };*/
+       "urxvt", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
        "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
 };
 const char *xlock[] = { "xlock", NULL };
@@ -51,11 +48,11 @@ static Key key[] = {
        { MODKEY|ShiftMask,     XK_3,           replacetag,     { .i = Twork } }, 
        { MODKEY|ShiftMask,     XK_4,           replacetag,     { .i = Tmisc } }, 
        { MODKEY|ShiftMask,     XK_c,           killclient,     { 0 } }, 
+       { MODKEY|ShiftMask,     XK_q,           quit,           { 0 } },
+       { MODKEY|ShiftMask,     XK_Return,      spawn,          { .argv = term } },
        { MODKEY|ShiftMask,     XK_g,           spawn,          { .argv = gimp } },
        { MODKEY|ShiftMask,     XK_l,           spawn,          { .argv = xlock } },
-       { MODKEY|ShiftMask,     XK_q,           quit,           { 0 } },
        { MODKEY|ShiftMask,     XK_w,           spawn,          { .argv = browse } },
-       { MODKEY|ShiftMask,     XK_Return,      spawn,          { .argv = term } },
 };
 
 /* END CUSTOMIZE */
@@ -166,11 +163,12 @@ buttonpress(XEvent *e)
                }
        }
        else if((c = getclient(ev->window))) {
+               focus(c);
                switch(ev->button) {
                default:
                        break;
                case Button1:
-                       if(arrange == dofloat || c->isfloat) {
+                       if(!c->ismax && (arrange == dofloat || c->isfloat)) {
                                higher(c);
                                movemouse(c);
                        }
@@ -179,7 +177,7 @@ buttonpress(XEvent *e)
                        lower(c);
                        break;
                case Button3:
-                       if(arrange == dofloat || c->isfloat) {
+                       if(!c->ismax && (arrange == dofloat || c->isfloat)) {
                                higher(c);
                                resizemouse(c);
                        }
@@ -241,7 +239,7 @@ enternotify(XEvent *e)
        Client *c;
        XCrossingEvent *ev = &e->xcrossing;
 
-       if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
+       if(ev->detail == NotifyInferior)
                return;
 
        if((c = getclient(ev->window)))
@@ -267,7 +265,7 @@ expose(XEvent *e)
 static void
 keypress(XEvent *e)
 {
-       static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0;
+       static unsigned int len = sizeof(key) / sizeof(key[0]);
        unsigned int i;
        KeySym keysym;
        XKeyEvent *ev = &e->xkey;
@@ -370,7 +368,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
 void
 grabkeys()
 {
-       static unsigned int len = key ? sizeof(key) / sizeof(key[0]) : 0;
+       static unsigned int len = sizeof(key) / sizeof(key[0]);
        unsigned int i;
        KeyCode code;