(Un)mark thumbnails while holding Button3 down
This commit is contained in:
parent
87a1ace8a1
commit
5367b75867
17
main.c
17
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));
|
|
||||||
redraw();
|
for (;;) {
|
||||||
|
if (sel >= 0 && mark_image(sel, on))
|
||||||
|
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 New Issue