commit fa740552b8684f27481ced58a235776a1807ce56
parent 5eb297142aa4bcabd7f6094af66bcffc8cf2b0a9
Author: wh1tepearl <wh1tepearl@gmail.com>
Date: Sun, 24 May 2026 12:42:34 +0100
improve the scroll binds
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vxwm.c b/vxwm.c
@@ -553,13 +553,16 @@ buttonpress(XEvent *e)
} else if ((c = wintoclient(ev->window))) {
focus(c);
restack(selmon);
- XAllowEvents(dpy, ReplayPointer, CurrentTime);
+ if (ev->button != Button4 && ev->button != Button5)
+ XAllowEvents(dpy, ReplayPointer, CurrentTime);
click = ClkClientWin;
}
for (i = 0; i < LENGTH(buttons); i++)
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);
+ if ((ev->button == Button4 || ev->button == Button5) && click == ClkClientWin)
+ XAllowEvents(dpy, AsyncPointer, CurrentTime);
}
void
@@ -1130,7 +1133,10 @@ grabbuttons(Client *c, int focused)
XGrabButton(dpy, buttons[i].button,
buttons[i].mask | modifiers[j],
c->win, False, BUTTONMASK,
- GrabModeAsync, GrabModeSync, None, None);
+ // use GrabModeSync for scroll wheel btns so when executing binds with the scroll wheel, windows dont get the scroll input. */
+ (buttons[i].button == Button4 || buttons[i].button == Button5)
+ ? GrabModeSync : GrabModeAsync,
+ GrabModeSync, None, None);
}
}