BListView: do not modify selection on MouseUp if drag & drop

bug seems to have been introduced only recently in hrev52062
This commit is contained in:
John Scipione
2018-07-04 21:55:35 -07:00
parent 4e5f9d9753
commit e2d19ae5b7
+7 -1
View File
@@ -592,6 +592,12 @@ BListView::MouseDown(BPoint where)
void void
BListView::MouseUp(BPoint where) BListView::MouseUp(BPoint where)
{ {
if (fTrack->is_dragging) {
// do selection only if a drag was not initiated
BView::MouseUp(where);
return;
}
int32 modifiers = 0; int32 modifiers = 0;
BMessage* message = Looper()->CurrentMessage(); BMessage* message = Looper()->CurrentMessage();
@@ -625,7 +631,7 @@ BListView::MouseUp(BPoint where)
Select(index); Select(index);
} }
} else { } else {
// toggle selection state of clicked item // toggle selection state of clicked item (except drag & drop)
if ((modifiers & B_COMMAND_KEY) != 0 && ItemAt(index)->IsSelected()) if ((modifiers & B_COMMAND_KEY) != 0 && ItemAt(index)->IsSelected())
Deselect(index); Deselect(index);
else else