- if (_view.cursors_shown()) {
- CursorPair &cursors = _view.cursors();
- if (cursors.first()->get_label_rect(
- rect()).contains(e->pos()))
- _grabbed_marker = cursors.first();
- else if (cursors.second()->get_label_rect(
- rect()).contains(e->pos()))
- _grabbed_marker = cursors.second();
- }
+ const vector< shared_ptr<TimeItem> > items(view_.time_items());
+ for (auto &i : items)
+ if (i && i->label_rect(rect()).contains(e->pos())) {
+ mouse_down_item_ = i;
+ break;
+ }