remove mousemove as it adds a HUGE performance issue
This commit is contained in:
parent
f266874abd
commit
692638248a
42
spmenu.c
42
spmenu.c
|
@ -1165,45 +1165,6 @@ out:
|
||||||
free(history);
|
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
|
void
|
||||||
buttonpress(XEvent *e)
|
buttonpress(XEvent *e)
|
||||||
{
|
{
|
||||||
|
@ -1501,9 +1462,6 @@ run(void)
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
buttonpress(&ev);
|
buttonpress(&ev);
|
||||||
break;
|
break;
|
||||||
case MotionNotify:
|
|
||||||
mousemove(&ev);
|
|
||||||
break;
|
|
||||||
case Expose:
|
case Expose:
|
||||||
if (ev.xexpose.count == 0)
|
if (ev.xexpose.count == 0)
|
||||||
drw_map(drw, win, 0, 0, mw, mh);
|
drw_map(drw, win, 0, 0, mw, mh);
|
||||||
|
|
Loading…
Reference in a new issue