BListView: check message not NULL, grab buttons and modifiers

This commit is contained in:
John Scipione
2016-08-18 16:36:45 -07:00
parent ccd7f24f11
commit a98f98b744
+8 -3
View File
@@ -537,6 +537,14 @@ BListView::MouseDown(BPoint where)
BMessage* message = Looper()->CurrentMessage();
int32 index = IndexOf(where);
int32 buttons = 0;
if (message != NULL)
message->FindInt32("buttons", &buttons);
int32 modifiers = 0;
if (message != NULL)
message->FindInt32("modifiers", &modifiers);
// If the user double (or more) clicked within the current selection,
// we don't change the selection but invoke the selection.
// TODO: move this code someplace where it can be shared everywhere
@@ -563,9 +571,6 @@ BListView::MouseDown(BPoint where)
return;
}
int32 modifiers;
message->FindInt32("modifiers", &modifiers);
if (!doubleClick) {
fTrack->drag_start = where;
fTrack->last_click_time = system_time();