diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc index 431115d860..31fb744f08 100644 --- a/gtk2_ardour/ardour_ui_dependents.cc +++ b/gtk2_ardour/ardour_ui_dependents.cc @@ -52,14 +52,12 @@ #include "trigger_page.h" #include "keyboard.h" #include "keyeditor.h" -#include "splash.h" #include "rc_option_editor.h" #include "route_params_ui.h" #include "time_info_box.h" #include "trigger_ui.h" #include "step_entry.h" #include "opts.h" -#include "utils.h" #ifdef GDK_WINDOWING_X11 #include @@ -204,7 +202,9 @@ ARDOUR_UI::tab_window_root_drop (GtkNotebook* src, bool ARDOUR_UI::idle_ask_about_quit () { - if (_session && _session->dirty()) { + const auto ask_before_closing = UIConfiguration::instance ().get_ask_before_closing_last_window (); + + if ((_session && _session->dirty ()) || !ask_before_closing) { finish (); } else { /* no session or session not dirty, but still ask anyway */ @@ -216,7 +216,7 @@ ARDOUR_UI::idle_ask_about_quit () true); /* modal */ msg.set_default_response (Gtk::RESPONSE_YES); - if (msg.run() == Gtk::RESPONSE_YES) { + if (msg.run () == Gtk::RESPONSE_YES) { finish (); } } diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index 845134e3a7..c90467f07a 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -138,6 +138,7 @@ UI_CONFIG_VARIABLE (bool, show_triggers_inline, "show-triggers-inline", false) UI_CONFIG_VARIABLE (bool, one_plugin_window_only, "one-plugin-window-only", false) UI_CONFIG_VARIABLE (int, default_lower_midi_note, "default-lower-midi-note", 60) UI_CONFIG_VARIABLE (int, default_upper_midi_note, "default-upper-midi-note", 71) +UI_CONFIG_VARIABLE (bool, ask_before_closing_last_window, "ask-before-closing-last-window", true) /* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */ UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)