From 77a8da9010320469d184a9e7e36957f9cb8880a5 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 6 Jul 2016 20:58:07 -0400 Subject: [PATCH] set ControlProtocol::_first_selected_stripable at the right time only --- libs/surfaces/control_protocol/control_protocol.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index 8accb99ea2..8c2a121779 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -360,13 +360,17 @@ ControlProtocol::set_first_selected_stripable (boost::shared_ptr s) void ControlProtocol::stripable_selection_changed (StripableNotificationListPtr sp) { + bool had_selection = !_last_selected.empty(); + _last_selected = *sp; { Glib::Threads::Mutex::Lock lm (first_selected_mutex); if (!_last_selected.empty()) { - _first_selected_stripable = _last_selected.front().lock(); + if (!had_selection) { + _first_selected_stripable = _last_selected.front().lock(); + } } else { _first_selected_stripable = boost::weak_ptr(); }