Introduce theme preference "transients follow front" which, when enabled,
authornick_m <mainsbridge@gmail.com>
Mon, 9 Mar 2015 15:25:25 +0000 (02:25 +1100)
committernick_m <mainsbridge@gmail.com>
Mon, 9 Mar 2015 15:25:25 +0000 (02:25 +1100)
sets transient windows to be transients for the front window when switching
between the editor and mixer. This is the current behavior on non-osx
builds.
When disabled, there is no reparenting of transient windows. This is the
current behavior on osx.
This preference defaults to off.

Also fix "all windows are dialogs" checkbox being out of sync with the ui
state.

gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/default_ui_config.in
gtk2_ardour/theme_manager.cc
gtk2_ardour/theme_manager.h
gtk2_ardour/ui_config_vars.h

index d5cbeeef1147f68014f6c81b91f057c9dd15ebbc..e382406eea46fc54bd635b95593169093064662a 100644 (file)
@@ -336,7 +336,9 @@ ARDOUR_UI::goto_editor_window ()
        editor->show_window ();
        editor->present ();
        /* mixer should now be on top */
-       WM::Manager::instance().set_transient_for (editor);
+       if (ARDOUR_UI::config()->get_transients_follow_front()) {
+               WM::Manager::instance().set_transient_for (editor);
+       }
        _mixer_on_top = false;
 }
 
@@ -365,7 +367,9 @@ ARDOUR_UI::goto_mixer_window ()
        mixer->show_window ();
        mixer->present ();
        /* mixer should now be on top */
-       WM::Manager::instance().set_transient_for (mixer);
+       if (ARDOUR_UI::config()->get_transients_follow_front()) {
+               WM::Manager::instance().set_transient_for (mixer);
+       }
        _mixer_on_top = true;
 }
 
index 00dd56a0ec8a9ced8a23fee4e8f25b732379d3b6..9c815d6331f69b68871a404d9445d82c4305f836 100644 (file)
@@ -9,6 +9,7 @@
     <Option name="waveform-gradient-depth" value="0"/>
     <Option name="timeline-item-gradient-depth" value="0.5"/>
     <Option name="all-floating-windows-are-dialogs" value="0"/>
+    <Option name="transients-follow-front" value="0"/>
     <Option name="color-regions-using-track-color" value="0"/>
     <Option name="show-waveform-clipping" value="1"/>
     <Option name="lock-gui-after-seconds" value="0"/>
index 44389da71197405d5039daaa068e3ffe06cf818b..6a557399db36072341029cf11ed749eac491457b 100644 (file)
@@ -74,6 +74,7 @@ ThemeManager::ThemeManager()
        , timeline_item_gradient_depth (0, 1.0, 0.05)
        , timeline_item_gradient_depth_label (_("Timeline item gradient depth"))
        , all_dialogs (_("All floating windows are dialogs"))
+       , transients_follow_front (_("Transient windows follow front window."))
        , icon_set_label (_("Icon Set"))
        , palette_viewport (*palette_scroller.get_hadjustment(), *palette_scroller.get_vadjustment())
        , palette_group (0)
@@ -115,6 +116,7 @@ ThemeManager::ThemeManager()
        pack_start (reset_button, PACK_SHRINK);
 #ifndef __APPLE__
        pack_start (all_dialogs, PACK_SHRINK);
+       pack_start (transients_follow_front, PACK_SHRINK);
 #endif
        pack_start (flat_buttons, PACK_SHRINK);
        pack_start (blink_rec_button, PACK_SHRINK);
@@ -184,12 +186,16 @@ ThemeManager::ThemeManager()
        waveform_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_waveform_gradient_depth_change));
        timeline_item_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_timeline_item_gradient_depth_change));
        all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
+       transients_follow_front.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_transients_follow_front_toggled));
        icon_set_dropdown.signal_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_icon_set_changed));
 
        Gtkmm2ext::UI::instance()->set_tip (all_dialogs, 
                                            string_compose (_("Mark all floating windows to be type \"Dialog\" rather than using \"Utility\" for some.\n"
                                                              "This may help with some window managers. This requires a restart of %1 to take effect"),
                                                            PROGRAM_NAME));
+       Gtkmm2ext::UI::instance()->set_tip (transients_follow_front, 
+                                           string_compose (_("Make transient windows follow the front window when toggling between the editor and mixer.\n"
+                                                             "This requires a restart of %1 to take effect"), PROGRAM_NAME));
 
        set_size_request (-1, 400);
        /* no need to call setup_palette() here, it will be done when its size is allocated */
@@ -297,6 +303,12 @@ ThemeManager::on_all_dialogs_toggled ()
        ARDOUR_UI::config()->set_all_floating_windows_are_dialogs (all_dialogs.get_active());
 }
 
+void
+ThemeManager::on_transients_follow_front_toggled ()
+{
+       ARDOUR_UI::config()->set_transients_follow_front (transients_follow_front.get_active());
+}
+
 void
 ThemeManager::on_waveform_gradient_depth_change ()
 {
@@ -358,6 +370,8 @@ ThemeManager::set_ui_to_state()
        /* there is no need to block signal handlers, here,
         * all elements check if the value has changed and ignore NOOPs 
         */
+       all_dialogs.set_active (ARDOUR_UI::config()->get_all_floating_windows_are_dialogs());
+       transients_follow_front.set_active (ARDOUR_UI::config()->get_transients_follow_front());
        flat_buttons.set_active (ARDOUR_UI::config()->get_flat_buttons());
        blink_rec_button.set_active (ARDOUR_UI::config()->get_blink_rec_arm());
        region_color_button.set_active (ARDOUR_UI::config()->get_color_regions_using_track_color());
index 6a5f5db79b229998b4fdc22f48cff2fb404f2025..20a73f0d4d065dde9a7fc4873e8cdb5920f26a52 100644 (file)
@@ -59,6 +59,7 @@ class ThemeManager : public Gtk::VBox
         void on_waveform_gradient_depth_change ();
         void on_timeline_item_gradient_depth_change ();
        void on_all_dialogs_toggled ();
+       void on_transients_follow_front_toggled ();
        void on_icon_set_changed ();
 
   private:
@@ -90,6 +91,7 @@ class ThemeManager : public Gtk::VBox
         Gtk::HScale timeline_item_gradient_depth;
         Gtk::Label timeline_item_gradient_depth_label;
        Gtk::CheckButton all_dialogs;
+       Gtk::CheckButton transients_follow_front;
        Gtk::CheckButton gradient_waveforms;
        Gtk::Label icon_set_label;
        Gtk::ComboBoxText icon_set_dropdown;
index d4e75f35d02c9e05d0227882f409d84c376c3192..b034864777691171b64bf78ad5efd132f0d441b6 100644 (file)
@@ -25,6 +25,7 @@ UI_CONFIG_VARIABLE (bool, blink_rec_arm, "blink-rec-arm", false)
 UI_CONFIG_VARIABLE (float, waveform_gradient_depth, "waveform-gradient-depth", 0)
 UI_CONFIG_VARIABLE (float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5)
 UI_CONFIG_VARIABLE (bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
+UI_CONFIG_VARIABLE (bool, transients_follow_front, "transients-follow-front", false)
 UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false)
 UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true)
 UI_CONFIG_VARIABLE (uint32_t, lock_gui_after_seconds, "lock-gui-after-seconds", 0)