Another try at fixing #4301.
git-svn-id: svn://localhost/ardour2/branches/3.0@10045 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9f1b50cc3e
commit
e3692bf3da
@ -104,6 +104,7 @@ GroupTabs::on_button_press_event (GdkEventButton* ev)
|
||||
|
||||
} else {
|
||||
_dragging_new_tab = false;
|
||||
_initial_dragging_routes = routes_for_tab (t);
|
||||
}
|
||||
|
||||
_dragging = t;
|
||||
@ -204,13 +205,15 @@ GroupTabs::on_button_release_event (GdkEventButton* ev)
|
||||
boost::shared_ptr<RouteList> r = _session->get_routes ();
|
||||
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
|
||||
|
||||
if (find (routes.begin(), routes.end(), *i) == routes.end()) {
|
||||
/* this route is not contained in the tab we are dragging ... */
|
||||
if ((*i)->route_group() != _dragging->group) {
|
||||
/* and it's not in the dragged tab's group either */
|
||||
_dragging->group->remove (*i);
|
||||
}
|
||||
} else {
|
||||
bool const was_in_tab = find (
|
||||
_initial_dragging_routes.begin(), _initial_dragging_routes.end(), *i
|
||||
) != _initial_dragging_routes.end ();
|
||||
|
||||
bool const now_in_tab = find (routes.begin(), routes.end(), *i) != routes.end();
|
||||
|
||||
if (was_in_tab && !now_in_tab) {
|
||||
_dragging->group->remove (*i);
|
||||
} else if (!was_in_tab && now_in_tab) {
|
||||
_dragging->group->add (*i);
|
||||
}
|
||||
}
|
||||
@ -222,6 +225,7 @@ GroupTabs::on_button_release_event (GdkEventButton* ev)
|
||||
}
|
||||
|
||||
_dragging = 0;
|
||||
_initial_dragging_routes.clear ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ private:
|
||||
Gtk::Menu* _menu;
|
||||
std::list<Tab> _tabs; ///< current list of tabs
|
||||
Tab* _dragging; ///< tab being dragged, or 0
|
||||
/** routes that were in the tab that is being dragged when the drag started */
|
||||
ARDOUR::RouteList _initial_dragging_routes;
|
||||
bool _dragging_new_tab; ///< true if we're dragging a new tab
|
||||
bool _drag_moved; ///< true if there has been movement during any current drag
|
||||
double _drag_fixed; ///< the position of the fixed end of the tab being dragged
|
||||
|
Loading…
Reference in New Issue
Block a user