don't hide ticks in narrow mode
[ardour.git] / gtk2_ardour / window_manager.cc
index 730668d7e439bac92896d6acd17e9f04e447c848..5fa1b6c7b0a98fd2f997c05aa20580024ef5790a 100644 (file)
@@ -52,6 +52,10 @@ Manager::Manager ()
 {
 }
 
+Manager::~Manager ()
+{
+}
+
 void
 Manager::register_window (ProxyBase* info)
 {
@@ -120,11 +124,9 @@ Manager::add_state (XMLNode& root) const
 void
 Manager::set_session (ARDOUR::Session* s)
 {
+       SessionHandlePtr::set_session (s);
        for (Windows::const_iterator i = _windows.begin(); i != _windows.end(); ++i) {
-               ARDOUR::SessionHandlePtr* sp = (*i)->session_handle ();
-               if (sp) {
-                       sp->set_session (s);
-               }
+               (*i)->set_session(s);
        }
 }
 
@@ -300,8 +302,10 @@ ProxyBase::get_state () const
                /* we have a window, so use current state */
 
                _visible = vistracker->partially_visible ();
-               _window->get_position (_x_off, _y_off);
-               _window->get_size (_width, _height);
+               if (_visible) {
+                       _window->get_position (_x_off, _y_off);
+                       _window->get_size (_width, _height);
+               }
        }
 
        node->add_property (X_("visible"), _visible? X_("yes") : X_("no"));
@@ -358,6 +362,7 @@ ProxyBase::setup ()
        if (_x_off != -1 && _y_off != -1) {
                _window->move (_x_off, _y_off);
        }
+       set_session(_session);
 }
        
 void
@@ -404,11 +409,21 @@ ProxyBase::hide ()
        }
 }
 
+bool
+ProxyBase::handle_win_event (GdkEventAny *ev)
+{
+       hide();
+       return true;
+}
+
 void
 ProxyBase::save_pos_and_size ()
 {
-       _window->get_position (_x_off, _y_off);
-       _window->get_size (_width, _height);
+       Gtk::Window* win = get (false);
+       if (win) {
+               win->get_position (_x_off, _y_off);
+               win->get_size (_width, _height);
+       }
 }
 /*-----------------------*/
 
@@ -422,6 +437,7 @@ ProxyTemporary::~ProxyTemporary ()
 {
 }
 
+
 ARDOUR::SessionHandlePtr*
 ProxyTemporary::session_handle()
 {