summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-12 22:49:15 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-12 22:49:15 -0400
commit8d1746501682da3e2937c7e8670354f79b656934 (patch)
tree293180d353c1bc1dca05105ac0d5b43e3d9611bf /libs/gtkmm2ext
parentd42f0754084d7c88e49b40ae05eaf70639adcac4 (diff)
give WindowProxy its own map/unmap signals so that other things can track map/unmap without accessing the Window
Diffstat (limited to 'libs/gtkmm2ext')
-rw-r--r--libs/gtkmm2ext/gtkmm2ext/window_proxy.h8
-rw-r--r--libs/gtkmm2ext/window_proxy.cc18
2 files changed, 25 insertions, 1 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/window_proxy.h b/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
index 52ccfc8c42..2aa7aec6f2 100644
--- a/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
+++ b/libs/gtkmm2ext/gtkmm2ext/window_proxy.h
@@ -81,6 +81,9 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
static std::string xml_node_name();
+ sigc::signal0<void> signal_map;
+ sigc::signal0<void> signal_unmap;
+
protected:
std::string _name;
std::string _menu_name;
@@ -95,6 +98,8 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
StateMask _state_mask;
sigc::connection delete_connection;
sigc::connection configure_connection;
+ sigc::connection map_connection;
+ sigc::connection unmap_connection;
void save_pos_and_size ();
@@ -103,7 +108,8 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
virtual bool delete_event_handler (GdkEventAny *ev);
virtual bool configure_handler (GdkEventConfigure*);
-
+ void map_handler ();
+ void unmap_handler ();
virtual void setup ();
void toggle ();
};
diff --git a/libs/gtkmm2ext/window_proxy.cc b/libs/gtkmm2ext/window_proxy.cc
index ee91b7e266..d0303c972b 100644
--- a/libs/gtkmm2ext/window_proxy.cc
+++ b/libs/gtkmm2ext/window_proxy.cc
@@ -230,6 +230,8 @@ WindowProxy::drop_window ()
if (_window) {
delete_connection.disconnect ();
configure_connection.disconnect ();
+ map_connection.disconnect ();
+ unmap_connection.disconnect ();
_window->hide ();
delete _window;
_window = 0;
@@ -255,10 +257,26 @@ WindowProxy::setup ()
delete_connection = _window->signal_delete_event().connect (sigc::mem_fun (*this, &WindowProxy::delete_event_handler));
configure_connection = _window->signal_configure_event().connect (sigc::mem_fun (*this, &WindowProxy::configure_handler), false);
+ map_connection = _window->signal_map().connect (sigc::mem_fun (*this, &WindowProxy::map_handler), false);
+ unmap_connection = _window->signal_unmap().connect (sigc::mem_fun (*this, &WindowProxy::unmap_handler), false);
set_pos_and_size ();
}
+void
+WindowProxy::map_handler ()
+{
+ /* emit our own signal */
+ signal_map ();
+}
+
+void
+WindowProxy::unmap_handler ()
+{
+ /* emit out own signal */
+ signal_unmap ();
+}
+
bool
WindowProxy::configure_handler (GdkEventConfigure* ev)
{