summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-08-04 14:30:41 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-02-22 15:31:23 -0500
commit00933950b7f21807fc4edf615876060f85882474 (patch)
tree33544e3960d4b3f6bb05915bac17516d76f9c802 /libs
parent2c6799f247afa3b77f0e3d878666409fd7f728bc (diff)
small rationalization of naming and code for managing plugin GUI visibility
Diffstat (limited to 'libs')
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/window_proxy.h3
-rw-r--r--libs/gtkmm2ext/window_proxy.cc12
2 files changed, 11 insertions, 4 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/window_proxy.h b/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
index a0026d9f97..e2f4d70951 100644
--- a/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
+++ b/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
@@ -66,8 +66,6 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
virtual Gtk::Window* get (bool create = false) = 0;
- virtual void toggle ();
-
virtual int set_state (const XMLNode&, int version);
virtual XMLNode& get_state ();
@@ -93,6 +91,7 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
virtual bool delete_event_handler (GdkEventAny *ev);
virtual void setup ();
+ void toggle ();
};
}
diff --git a/libs/gtkmm2ext/window_proxy.cc b/libs/gtkmm2ext/window_proxy.cc
index 6f20eaa8d5..d7670cb89e 100644
--- a/libs/gtkmm2ext/window_proxy.cc
+++ b/libs/gtkmm2ext/window_proxy.cc
@@ -22,6 +22,7 @@
#include "pbd/convert.h"
#include "pbd/xml++.h"
+#include "pbd/stacktrace.h"
#include "gtkmm2ext/window_proxy.h"
#include "gtkmm2ext/visibility_tracker.h"
@@ -139,6 +140,7 @@ WindowProxy::toggle()
{
if (!_window) {
(void) get (true);
+ setup ();
assert (_window);
/* XXX this is a hack - the window object should really
ensure its components are all visible. sigh.
@@ -146,12 +148,13 @@ WindowProxy::toggle()
_window->show_all();
/* we'd like to just call this and nothing else */
_window->present ();
-
} else {
if (_window->is_mapped()) {
save_pos_and_size();
}
+
vistracker->cycle_visibility ();
+
if (_window->is_mapped()) {
if (_width != -1 && _height != -1) {
_window->set_default_size (_width, _height);
@@ -279,7 +282,12 @@ WindowProxy::hide ()
bool
WindowProxy::delete_event_handler (GdkEventAny* /*ev*/)
{
- hide();
+ if (_action) {
+ _action->activate ();
+ } else {
+ hide();
+ }
+
return true;
}