From 400b3f82e7e66eed1ef80547830152b03e7d8a2e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 12 Mar 2017 16:54:38 +0100 Subject: [PATCH] Prevent multiple color-picker dialogs for a single stripable --- gtk2_ardour/stripable_colorpicker.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gtk2_ardour/stripable_colorpicker.cc b/gtk2_ardour/stripable_colorpicker.cc index a7db947df8..2e341f4d7e 100644 --- a/gtk2_ardour/stripable_colorpicker.cc +++ b/gtk2_ardour/stripable_colorpicker.cc @@ -70,12 +70,19 @@ void StripableColorDialog::reset () { hide (); + if (_stripable && _stripable->active_color_picker() == this) { + _stripable->set_active_color_picker (0); + } _stripable.reset (); } void StripableColorDialog::popup (boost::shared_ptr s) { + if (s && s->active_color_picker()) { + s->active_color_picker()->present (); + return; + } if (_stripable == s) { /* keep modified color */ present (); @@ -83,6 +90,7 @@ StripableColorDialog::popup (boost::shared_ptr s) } _stripable = s; + _stripable->set_active_color_picker (this); set_title (string_compose (_("Color Selection: %1"), s->name())); get_colorsel()->set_has_opacity_control (false);