Hello.
I started trying out dwm (5.0.1) yesterday, and I really like it! Good
work there.
However, I encountered some problems when I was modifying the actions
related to window mouse clicking. Changing the event mask for
ClkClientWin in buttons array did not work without modifying
dwm.c:grabbuttons() accordingly. Therefore, I removed the assumption
that MODKEY would be used as event mask, and instead grab only the
buttons and event masks that really are used; see grabbuttons.diff.
Maybe something that Anselm likes to apply?
/Fredrik
--- dwm-5.0.1/dwm.c 2008-06-19 10:11:38.000000000 +0200
+++ dwm-5.0.1-fred/dwm.c 2008-06-29 15:43:52.706624943 +0200
@@ -733,16 +741,15 @@
void
grabbuttons(Client *c, Bool focused) {
int i, j;
- uint buttons[] = { Button1, Button2, Button3 };
- uint modifiers[] = { MODKEY, MODKEY|LockMask, MODKEY|numlockmask, MODKEY|numlockmask|LockMask };
+ uint modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
- if(focused)
+ if(focused) {
for(i = 0; i < LENGTH(buttons); i++)
- for(j = 0; j < LENGTH(modifiers); j++)
- XGrabButton(dpy, buttons[i], modifiers[j], c->win, False,
- BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
- else
+ 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
XGrabButton(dpy, AnyButton, AnyModifier, c->win, False,
BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
}