Open luebking opened 8 years ago
Better variant (keeps highlight under the pointer):
diff --git a/dmenu.c b/dmenu.c
index 6c66db8..182eab3 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -725,14 +725,22 @@ buttonpress(XEvent *e) {
}
/* scroll up */
if(ev->button == Button4 && prev) {
- sel = curr = prev;
+ int i = 0;
+ while(++i < 4 && sel && sel->left && curr && curr->left) {
+ curr = curr->left;
+ sel = sel->left;
+ }
calcoffsets();
drawmenu();
return;
}
/* scroll down */
if(ev->button == Button5 && next) {
- sel = curr = next;
+ int i = 0;
+ while(++i < 4 && sel && sel->right && curr && curr->right) {
+ curr = curr->right;
+ sel = sel->right;
+ }
calcoffsets();
drawmenu();
return;
Hi, this worked nicely with dmenu-4.6, but with dmenu-4.7 it's not. There's hardly any differences between the mousesupport patch versions either.
Patch still applies and works (for me) on dmenu-ee git master - commit e41155235c53a1d6af2251280b4a629588bb01f (which fell behind dmenu upstream?)
How do you patch http://tools.suckless.org/dmenu/ in total?
Yeah it's somewhat behind upstream.. I patch official 'mousesupport-4.7', then '3linesperwheel' and a adapted version of 'xyw' for dmenu-4.7. I was sure this would fly, but I must be overlooking something. Thanks!
One could add a switch to control this, interpreting "0" (the default) as the present page scrolling behavior. Opinions?