ActionManager::add_action_group (window_actions);
}
- info->set_action (ActionManager::register_action (window_actions, info->action_name().c_str(), info->menu_name().c_str(),
+ info->set_action (ActionManager::register_action (window_actions, info->action_name().c_str(), info->menu_name().c_str(),
sigc::bind (sigc::mem_fun (*this, &Manager::toggle_window), info)));
}
}
{
for (Windows::const_iterator i = _windows.begin(); i != _windows.end(); ++i) {
if ((*i)->visible()) {
+ if (! (*i)->get (true)) {
+ /* the window may be a plugin GUI for a plugin which
+ * is disabled or longer present.
+ */
+ continue;
+ }
(*i)->show_all ();
(*i)->present ();
}
/* OS X has a richer concept of window layering than X does (or
* certainly, than any accepted conventions on X), and so the use of
* Manager::set_transient_for() is not necessary on that platform.
- *
+ *
* On OS X this is mostly taken care of by using the window type rather
* than explicit 1:1 transient-for relationships.
*/
}
}
}
-
+
current_transient_parent = parent;
#endif
}
, _x_off (-1)
, _y_off (-1)
, _width (-1)
- , _height (-1)
+ , _height (-1)
, vistracker (0)
{
}
, _x_off (-1)
, _y_off (-1)
, _width (-1)
- , _height (-1)
+ , _height (-1)
, vistracker (0)
{
set_state (node);
}
std::string
-ProxyBase::action_name() const
+ProxyBase::action_name() const
{
return string_compose (X_("toggle-%1"), _name);
}
void
-ProxyBase::toggle()
+ProxyBase::toggle()
{
if (!_window) {
(void) get (true);
ProxyBase::get_state () const
{
XMLNode* node = new XMLNode (X_("Window"));
- char buf[32];
+ char buf[32];
node->add_property (X_("name"), _name);
if (_window && vistracker) {
-
+
/* we have a window, so use current state */
_visible = vistracker->partially_visible ();
}
node->add_property (X_("visible"), _visible? X_("yes") : X_("no"));
-
+
snprintf (buf, sizeof (buf), "%d", _x_off);
node->add_property (X_("x-off"), buf);
snprintf (buf, sizeof (buf), "%d", _y_off);
assert (_window);
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
- _window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::handle_win_event));
+ _window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::delete_event_handler));
if (_width != -1 || _height != -1 || _x_off != -1 || _y_off != -1) {
/* cancel any mouse-based positioning */
}
set_session(_session);
}
-
+
void
ProxyBase::show ()
{
- Gtk::Window* win = get (true);
- win->show ();
+ get (true);
+ assert (_window);
+ _window->show ();
}
void
void
ProxyBase::show_all ()
{
- Gtk::Window* win = get (true);
- win->show_all ();
+ get (true);
+ assert (_window);
+ _window->show_all ();
}
-
void
ProxyBase::present ()
{
- Gtk::Window* win = get (true);
- win->show_all ();
- win->present ();
+ get (true);
+ assert (_window);
+
+ _window->show_all ();
+ _window->present ();
/* turn off any mouse-based positioning */
_window->set_position (Gtk::WIN_POS_NONE);
void
ProxyBase::hide ()
{
- Gtk::Window* win = get (false);
- if (win) {
+ if (_window) {
save_pos_and_size();
- win->hide ();
+ _window->hide ();
}
}
bool
-ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
+ProxyBase::delete_event_handler (GdkEventAny* /*ev*/)
{
hide();
return true;
void
ProxyBase::save_pos_and_size ()
{
- Gtk::Window* win = get (false);
- if (win) {
- win->get_position (_x_off, _y_off);
- win->get_size (_width, _height);
+ if (_window) {
+ _window->get_position (_x_off, _y_off);
+ _window->get_size (_width, _height);
}
}
/*-----------------------*/