From 692638248a8b3d39ab01012de1c4f7ab07a48057 Mon Sep 17 00:00:00 2001 From: speedie Date: Sun, 22 Jan 2023 14:53:24 +0100 Subject: [PATCH] remove mousemove as it adds a HUGE performance issue --- spmenu.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/spmenu.c b/spmenu.c index a3ef66c..3f8dd0f 100644 --- a/spmenu.c +++ b/spmenu.c @@ -1165,45 +1165,6 @@ out: free(history); } -void -mousemove(XEvent *e) -{ - struct item *item; - XPointerMovedEvent *ev = &e->xmotion; - int x = 0, y = 0, h = bh, w, item_num = 0; - - if (lines > 0) { - w = mw - x; - for (item = curr; item != next; item = item->right) { - if (item_num++ == lines) { - item_num = 1; - x += w / columns; - y = 0; - } - y += h; - if (ev->y >= y && ev->y <= (y + h) && ev->x >= x && ev->x <= (x + w / columns)) { - sel = item; - calcoffsets(); - drawmenu(); - return; - } - } - } else if (matches) { - x += inputw + promptw; - w = TEXTW(leftarrow); - for (item = curr; item != next; item = item->right) { - x += w; - w = MIN(TEXTW(item->text), mw - x - TEXTW(rightarrow)); - if (ev->x >= x && ev->x <= x + w) { - sel = item; - calcoffsets(); - drawmenu(); - return; - } - } - } -} - void buttonpress(XEvent *e) { @@ -1501,9 +1462,6 @@ run(void) case ButtonPress: buttonpress(&ev); break; - case MotionNotify: - mousemove(&ev); - break; case Expose: if (ev.xexpose.count == 0) drw_map(drw, win, 0, 0, mw, mh);