From 5e7c325874d1ac9698f7fcd70359101a76b14fda Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Fri, 7 Jan 2022 17:57:16 +0100 Subject: [PATCH] BugFix: double-clic selection of mixing group crash Improved CTRL+Clic for mixing group selection instead. --- MixingView.cpp | 11 +++++++++-- UserInterfaceManager.cpp | 7 +------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/MixingView.cpp b/MixingView.cpp index b6816ef..778f443 100644 --- a/MixingView.cpp +++ b/MixingView.cpp @@ -442,8 +442,15 @@ std::pair MixingView::pick(glm::vec2 P) if (UserInterface::manager().ctrlModifier()) { SourceList linked = s->mixinggroup_->getCopy(); linked.remove(s); - if (Mixer::selection().empty()) - Mixer::selection().add(linked); + if (linked.size() > 0) { + // avoid de-selection of current source if in a mixing group + if (Mixer::selection().contains(s) && Mixer::selection().size() < 2) + Mixer::selection().clear(); + // instead, select all sources linked + if (Mixer::selection().empty()) + Mixer::selection().add(linked); + // the source will be re-selected in UserInterface::handleMouse() + } } else if (UserInterface::manager().shiftModifier()) s->mixinggroup_->setAction( MixingGroup::ACTION_GRAB_ONE ); diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index dd90db3..ce0d9fa 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -565,12 +565,7 @@ void UserInterface::handleMouse() // discard current to select front most source // (because single clic maintains same source active) Mixer::manager().unsetCurrentSource(); - else { - MixingGroup *g = Mixer::manager().currentSource()->mixingGroup(); - if (g != nullptr){ - Mixer::selection().set( g->getCopy() ); - } - } + // display source in left pannel navigator.showPannelSource( Mixer::manager().indexCurrentSource() ); }