diff -r ee12ffbf93df config.def.h --- a/config.def.h Tue Mar 17 19:53:00 2009 +0000 +++ b/config.def.h Fri Mar 20 21:47:49 2009 +1100 @@ -81,8 +81,8 @@ static Key keys[] = { }; /* button definitions */ -/* click can be a tag number (starting at 0), - * ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +/* click can be any bitwise combination of ClkLtSymbol, ClkStatusText, + * ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { /* click event mask button function argument */ { ClkLtSymbol, 0, Button1, setlayout, {0} }, diff -r ee12ffbf93df dwm.c --- a/dwm.c Tue Mar 17 19:53:00 2009 +0000 +++ b/dwm.c Fri Mar 20 21:47:49 2009 +1100 @@ -60,8 +60,8 @@ enum { CurNormal, CurResize, CurMove, Cu enum { ColBorder, ColFG, ColBG, ColLast }; /* color */ enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, - ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ +enum { ClkTagBar=1, ClkLtSymbol=1<<1, ClkStatusText=1<<2, ClkWinTitle=1<<3, + ClkClientWin=1<<4, ClkRootWin=1<<5, ClkLast=1<<6 }; /* clicks */ typedef union { int i; @@ -389,9 +389,9 @@ buttonpress(XEvent *e) { } for(i = 0; i < LENGTH(buttons); i++) - if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button + if(click & buttons[i].click && buttons[i].func && buttons[i].button == ev->button && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) - buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); + buttons[i].func(click & ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg); } void @@ -799,7 +799,7 @@ grabbuttons(Client *c, Bool focused) { XUngrabButton(dpy, AnyButton, AnyModifier, c->win); if(focused) { for(i = 0; i < LENGTH(buttons); i++) - if(buttons[i].click == ClkClientWin) + if(buttons[i].click & ClkClientWin) for(j = 0; j < LENGTH(modifiers); j++) XGrabButton(dpy, buttons[i].button, buttons[i].mask | modifiers[j], c->win, False, BUTTONMASK, GrabModeAsync, GrabModeSync, None, None); } else @@ -1321,8 +1321,7 @@ setup(void) { /* select for events */ wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask - |EnterWindowMask|LeaveWindowMask|StructureNotifyMask - |PropertyChangeMask; + |EnterWindowMask|StructureNotifyMask|PropertyChangeMask; XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); XSelectInput(dpy, root, wa.event_mask);