From 8d1746501682da3e2937c7e8670354f79b656934 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 12 Jun 2016 22:49:15 -0400 Subject: [PATCH] give WindowProxy its own map/unmap signals so that other things can track map/unmap without accessing the Window --- libs/gtkmm2ext/gtkmm2ext/window_proxy.h | 8 +++++++- libs/gtkmm2ext/window_proxy.cc | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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 signal_map; + sigc::signal0 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) { -- 2.30.2