diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2012-06-27 12:21:23 +0000 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2012-06-27 12:21:23 +0000 |
commit | 5ba1996fd70f05362c70b54e68261b955659f291 (patch) | |
tree | 9e30d384f33df9f3eff2d84175752cd9d2390da5 /gtk2_ardour/ardour_ui_dependents.cc | |
parent | 266030b79c19c144cc093d69ee57117f742f8347 (diff) |
A (hopefully) better fix for toggle-mixer-on-top, using gtk_window_is_active() to work out whether the mixer is already on top.
git-svn-id: svn://localhost/ardour2/branches/3.0@12952 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui_dependents.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui_dependents.cc | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 2b0e0df215..99b27d75d6 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -133,25 +133,21 @@ ARDOUR_UI::toggle_mixer_window () void ARDOUR_UI::toggle_mixer_on_top () { - /* Only called if the editor window received the shortcut key or if selected - from the editor window menu, so the mixer is definitely not on top, and - we can unconditionally make it so here. - - XXX this might not work so well where there is a global menu bar, e.g. - on OS X. - */ - - /* Toggle the mixer to `visible' if required */ - Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer")); - if (act) { - Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); - if (!tact->get_active()) { - tact->set_active (true); + if (gtk_window_is_active(Mixer_UI::instance()->gobj())) { + goto_editor_window (); + } else { + Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer")); + if (act) { + Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act); + + /* Toggle the mixer to `visible' if required */ + if (!tact->get_active ()) { + tact->set_active (true); + } } + goto_mixer_window (); } - - goto_mixer_window (); } /** The main editor window has been closed */ |