diff dwm-5.8.2/config.h dwm-5.8.2mod/config.h 92a93 > { ClkWinTitle, 0, Button3, startgesture, {0} }, 100a102,113 > }; > > //may want to reuse the architecture present in buttons[] and keys[] > static Gesture gestures[] = { > {"dl", spawn, SHCMD("konqueror") }, > {"dr", spawn, SHCMD("pidgin" ) }, > {"l", spawn, SHCMD("xterm") }, > {"ld", spawn, SHCMD("gimp" ) }, > {"lr", spawn, SHCMD("google-chrome") }, > {"r" , spawn, SHCMD("firefox") }, > {"rl", spawn, SHCMD("pavucontrol") }, > {"du", spawn, SHCMD("kate") }, Only in dwm-5.8.2mod: config.h~ Binary files dwm-5.8.2/dwm and dwm-5.8.2mod/dwm differ diff dwm-5.8.2/dwm.c dwm-5.8.2mod/dwm.c 73a74,79 > char *name; > void (*func)(const Arg *arg); > const Arg arg; > } Gesture; > > typedef struct { 244a251 > static void startgesture(const Arg *arg); 1248a1256,1318 > > void > startgesture(const Arg *arg) { > int x, y, dx, dy, q; > int valid=0, listpos=0, gestpos=0, count=0; > char move, currGest[10]; > XEvent ev; > > if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, > None, cursor[CurMove], CurrentTime) != GrabSuccess) > return; > if(!getrootptr(&x, &y)) > return; > do { > XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); > switch (ev.type) { > case ConfigureRequest: > case Expose: > case MapRequest: > handler[ev.type](&ev); > break; > case MotionNotify: > if(count++ < 10) > break; > count = 0; > dx = ev.xmotion.x - x; > dy = ev.xmotion.y - y; > x = ev.xmotion.x; > y = ev.xmotion.y; > > if( abs(dx)/(abs(dy)+1) == 0 ) > move = dy<0?'u':'d'; > else > move = dx<0?'l':'r'; > > if(move!=currGest[gestpos-1]) > { > if(gestpos>9) > { ev.type++; > break; > } > > currGest[gestpos] = move; > currGest[++gestpos] = '\0'; > > valid = 0; > for(q = 0; q { if(!strcmp(currGest, gestures[q].name)) > { valid++; > listpos = q; > } > } > } > > } > } while(ev.type != ButtonRelease); > > if(valid) > gestures[listpos].func(&(gestures[listpos].arg)); > > XUngrabPointer(dpy, CurrentTime); > } > Only in dwm-5.8.2mod: dwm.c~ Binary files dwm-5.8.2/dwm.o and dwm-5.8.2mod/dwm.o differ