- // Move the signals if we are dragging
- if (!_drag_sigs.empty()) {
- const int delta = event->pos().y() - _mouse_down_point.y();
-
- for (std::list<std::pair<boost::weak_ptr<Signal>,
- int> >::iterator i = _drag_sigs.begin();
- i != _drag_sigs.end(); i++) {
- const boost::shared_ptr<Signal> sig((*i).first);
- if (sig) {
- const int y = (*i).second + delta;
- const int y_snap =
- ((y + View::SignalSnapGridSize / 2) /
- View::SignalSnapGridSize) *
- View::SignalSnapGridSize;
- sig->set_v_offset(y_snap);
-
- // Ensure the signal is selected
- sig->select();
- }
-
+ if (!(event->buttons() & Qt::LeftButton))
+ return;
+
+ if ((event->pos() - _mouse_down_point).manhattanLength() <
+ QApplication::startDragDistance())
+ return;
+
+ // Check all the drag items share a common owner
+ RowItemOwner *item_owner = nullptr;
+ for (shared_ptr<RowItem> r : _view)
+ if (r->dragging()) {
+ if (!item_owner)
+ item_owner = r->owner();
+ else if(item_owner != r->owner())
+ return;