summaryrefslogtreecommitdiff
path: root/gtk2_ardour/processor_box.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-02 01:59:24 +0200
committerRobin Gareus <robin@gareus.org>2017-07-02 01:59:24 +0200
commit496f83bf83cc5fce7e99fa99ed8256259eef5793 (patch)
tree7aa3d0da6affb75b021ea305f0a7fba2e5fc7a18 /gtk2_ardour/processor_box.cc
parent15b6b2911224fcb108c4b9ca7a09b7cf8cfd0f0a (diff)
Allow ctrl-surfaces to show/hide plugin UIs.
Diffstat (limited to 'gtk2_ardour/processor_box.cc')
-rw-r--r--gtk2_ardour/processor_box.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index aa5d6380df..61b80116ca 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -4209,14 +4209,18 @@ ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* b
: WM::ProxyBase (name, string())
, _processor_box (box)
, _processor (processor)
- , is_custom (false)
- , want_custom (false)
+ , is_custom (true)
+ , want_custom (true)
{
boost::shared_ptr<Processor> p = _processor.lock ();
if (!p) {
return;
}
p->DropReferences.connect (going_away_connection, MISSING_INVALIDATOR, boost::bind (&ProcessorWindowProxy::processor_going_away, this), gui_context());
+
+ p->ToggleUI.connect (gui_connections, invalidator (*this), boost::bind (&ProcessorWindowProxy::show_the_right_window, this, false), gui_context());
+ p->ShowUI.connect (gui_connections, invalidator (*this), boost::bind (&ProcessorWindowProxy::show_the_right_window, this, true), gui_context());
+ p->HideUI.connect (gui_connections, invalidator (*this), boost::bind (&ProcessorWindowProxy::hide, this), gui_context());
}
ProcessorWindowProxy::~ProcessorWindowProxy()
@@ -4231,6 +4235,7 @@ ProcessorWindowProxy::~ProcessorWindowProxy()
void
ProcessorWindowProxy::processor_going_away ()
{
+ gui_connections.drop_connections ();
delete _window;
_window = 0;
WM::Manager::instance().remove (this);
@@ -4308,13 +4313,16 @@ ProcessorWindowProxy::get (bool create)
}
void
-ProcessorWindowProxy::show_the_right_window ()
+ProcessorWindowProxy::show_the_right_window (bool show_not_toggle)
{
if (_window && (is_custom != want_custom)) {
/* drop existing window - wrong type */
set_state_mask (Gtkmm2ext::WindowProxy::StateMask (state_mask () & ~WindowProxy::Size));
drop_window ();
}
+ if (_window && fully_visible () && show_not_toggle) {
+ return;
+ }
toggle ();
}