X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=event.c;h=17be71d3eb4d51e9a57b8e4c2907193cab5bba5c;hb=7b5638f61d5c8b5a76bc3f7a5962cb7490da3b6b;hp=aa074275ccc300a2554dfcbd803a4af5e64fbe1d;hpb=0c7bcc24cbd0d721a4e7d152c05886ac30cc4af3;p=dwm.git diff --git a/event.c b/event.c index aa07427..17be71d 100644 --- a/event.c +++ b/event.c @@ -8,9 +8,6 @@ #include #include -#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,6 +163,7 @@ buttonpress(XEvent *e) } } else if((c = getclient(ev->window))) { + focus(c); switch(ev->button) { default: break; @@ -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;