track geometry via configure events for tabbable own-windows
This commit is contained in:
parent
ae7cc64377
commit
4963d65206
@ -93,12 +93,15 @@ class LIBGTKMM2EXT_API WindowProxy : public PBD::StatefulDestructible, public vi
|
|||||||
mutable int _height; ///< height
|
mutable int _height; ///< height
|
||||||
Gtkmm2ext::VisibilityTracker* vistracker;
|
Gtkmm2ext::VisibilityTracker* vistracker;
|
||||||
StateMask _state_mask;
|
StateMask _state_mask;
|
||||||
|
sigc::connection delete_connection;
|
||||||
|
sigc::connection configure_connection;
|
||||||
|
|
||||||
void save_pos_and_size ();
|
void save_pos_and_size ();
|
||||||
void set_pos_and_size ();
|
void set_pos_and_size ();
|
||||||
void set_pos ();
|
void set_pos ();
|
||||||
|
|
||||||
virtual bool delete_event_handler (GdkEventAny *ev);
|
virtual bool delete_event_handler (GdkEventAny *ev);
|
||||||
|
virtual bool configure_handler (GdkEventConfigure*);
|
||||||
|
|
||||||
virtual void setup ();
|
virtual void setup ();
|
||||||
void toggle ();
|
void toggle ();
|
||||||
|
@ -228,6 +228,8 @@ void
|
|||||||
WindowProxy::drop_window ()
|
WindowProxy::drop_window ()
|
||||||
{
|
{
|
||||||
if (_window) {
|
if (_window) {
|
||||||
|
delete_connection.disconnect ();
|
||||||
|
configure_connection.disconnect ();
|
||||||
_window->hide ();
|
_window->hide ();
|
||||||
delete _window;
|
delete _window;
|
||||||
_window = 0;
|
_window = 0;
|
||||||
@ -250,11 +252,27 @@ WindowProxy::setup ()
|
|||||||
assert (_window);
|
assert (_window);
|
||||||
|
|
||||||
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
|
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
|
||||||
_window->signal_delete_event().connect (sigc::mem_fun (*this, &WindowProxy::delete_event_handler));
|
|
||||||
|
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);
|
||||||
|
|
||||||
set_pos_and_size ();
|
set_pos_and_size ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
WindowProxy::configure_handler (GdkEventConfigure* ev)
|
||||||
|
{
|
||||||
|
/* stupidly, the geometry data in the event isn't the same as we get
|
||||||
|
from the window geometry APIs.so we have to actively interrogate
|
||||||
|
them to get the new information.
|
||||||
|
|
||||||
|
the difference is generally down to window manager framing.
|
||||||
|
*/
|
||||||
|
save_pos_and_size ();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
WindowProxy::visible() const
|
WindowProxy::visible() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user