(Un)mark thumbnails while holding Button3 down
This commit is contained in:
parent
87a1ace8a1
commit
5367b75867
15
main.c
15
main.c
|
@ -663,10 +663,19 @@ void on_buttonpress(XButtonEvent *bev)
|
||||||
break;
|
break;
|
||||||
case Button3:
|
case Button3:
|
||||||
if ((sel = tns_translate(&tns, bev->x, bev->y)) >= 0) {
|
if ((sel = tns_translate(&tns, bev->x, bev->y)) >= 0) {
|
||||||
files[sel].flags ^= FF_MARK;
|
bool on = !(files[sel].flags & FF_MARK);
|
||||||
markcnt += files[sel].flags & FF_MARK ? 1 : -1;
|
XEvent e;
|
||||||
tns_mark(&tns, sel, !!(files[sel].flags & FF_MARK));
|
|
||||||
|
for (;;) {
|
||||||
|
if (sel >= 0 && mark_image(sel, on))
|
||||||
redraw();
|
redraw();
|
||||||
|
XMaskEvent(win.env.dpy,
|
||||||
|
ButtonPressMask | ButtonReleaseMask | PointerMotionMask, &e);
|
||||||
|
if (e.type == ButtonPress || e.type == ButtonRelease)
|
||||||
|
break;
|
||||||
|
while (XCheckTypedEvent(win.env.dpy, MotionNotify, &e));
|
||||||
|
sel = tns_translate(&tns, e.xbutton.x, e.xbutton.y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Button4:
|
case Button4:
|
||||||
|
|
Loading…
Reference in a new issue