Fix Select/Hold Browser callback with FL_WHEN_RELEASE when mouse is dragged

This commit is contained in:
dannye
2026-04-04 12:08:15 -05:00
committed by ManoloFLTK
parent 99648c047c
commit 079f29ca5a
+3 -2
View File
@@ -789,6 +789,7 @@ J1:
// This second call of Fl_Browser_::handle() may result in a -
// somewhat unexpected - second concurrent invocation of the callback.
static void* initsel;
static char change;
static char whichway;
static int py;
@@ -800,6 +801,7 @@ J1:
redraw();
}
my = py = Fl::event_y();
initsel = selection_;
change = 0;
if (type() == FL_NORMAL_BROWSER || !top_)
;
@@ -904,11 +906,10 @@ J1:
}
if (l) selection_ = l;
} else {
void* l1 = selection_;
void* l =
(Fl::event_x()<x() || Fl::event_x()>x()+w()) ? selection_ :
find_item(my);
change = (l != l1);
change = (l != initsel);
select_only(l, when() & FL_WHEN_CHANGED);
if (wp.deleted()) return 1;
}