Splash screen quirks, fix --no-splash

Add preference to hide splash instead of re-layering it
This commit is contained in:
Robin Gareus 2021-07-04 21:48:12 +02:00
parent e8577e0d1a
commit a069af796d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 39 additions and 5 deletions

View File

@ -2857,6 +2857,17 @@ These settings will only take effect after %1 is restarted.\n\
add_option (_("Appearance/Quirks"), bo);
#ifndef __APPLE__
#ifndef PLATFORM_WINDOWS
bo = new BoolOption (
"hide-splash-screen",
_("Show/Hide splash screen instead of setting z-axis stack order"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_hide_splash_screen),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_hide_splash_screen)
);
add_option (_("Appearance/Quirks"), bo);
#endif
bo = new BoolOption (
"all-floating-windows-are-dialogs",
_("All floating windows are dialogs"),

View File

@ -35,7 +35,9 @@
#endif
#include "gui_thread.h"
#include "opts.h"
#include "splash.h"
#include "ui_config.h"
#include "pbd/i18n.h"
@ -119,7 +121,10 @@ Splash::Splash ()
expose_done = false;
expose_is_the_one = false;
ARDOUR::BootMessage.connect (msg_connection, invalidator (*this), boost::bind (&Splash::boot_message, this, _1), gui_context());
if (!ARDOUR_COMMAND_LINE::no_splash) {
ARDOUR::BootMessage.connect (msg_connection, invalidator (*this), boost::bind (&Splash::boot_message, this, _1), gui_context());
present ();
}
}
Splash::~Splash ()
@ -133,6 +138,7 @@ Splash::~Splash ()
void
Splash::pop_back_for (Gtk::Window& win)
{
set_keep_above (false);
#if defined __APPLE__ || defined PLATFORM_WINDOWS
/* April 2013: window layering on OS X is a bit different to X Window. at present,
* the "restack()" functionality in GDK will only operate on windows in the same
@ -149,9 +155,11 @@ Splash::pop_back_for (Gtk::Window& win)
(void) win;
hide();
#else
set_keep_above (false);
if (is_mapped()) {
if (UIConfiguration::instance().get_hide_splash_screen ()) {
hide ();
} else if (is_mapped()) {
get_window()->restack (win.get_window(), false);
win.set_transient_for (*this);
}
#endif
_window_stack.insert (&win);
@ -177,13 +185,22 @@ Splash::pop_front ()
return;
}
if (ARDOUR_COMMAND_LINE::no_splash) {
return;
}
if (get_window()) {
#if defined __APPLE__ || defined PLATFORM_WINDOWS
show ();
#else
gdk_window_restack(get_window()->gobj(), NULL, true);
set_keep_above (true);
if (UIConfiguration::instance().get_hide_splash_screen ()) {
show ();
} else {
unset_transient_for ();
gdk_window_restack (get_window()->gobj(), NULL, true);
}
#endif
set_keep_above (true);
}
}
@ -268,6 +285,10 @@ Splash::display ()
{
bool was_mapped = is_mapped ();
if (ARDOUR_COMMAND_LINE::no_splash) {
return;
}
if (!was_mapped) {
expose_done = false;
expose_is_the_one = false;

View File

@ -438,6 +438,7 @@ StartupFSM::show_audiomidi_dialog ()
void
StartupFSM::start_audio_midi_setup ()
{
BootMessage (_("Starting Audio/MIDI Engine"));
bool setup_required = false;
boost::shared_ptr<AudioBackend> backend = AudioEngine::instance()->current_backend();

View File

@ -114,6 +114,7 @@ UI_CONFIG_VARIABLE (int32_t, max_plugin_recent, "max-plugin-recent", 10)
UI_CONFIG_VARIABLE (bool, prefer_inline_over_gui, "prefer-inline-over-gui", true)
UI_CONFIG_VARIABLE (uint32_t, max_inline_controls, "max-inline-controls", 32) /* per processor */
UI_CONFIG_VARIABLE (uint32_t, action_table_columns, "action-table-columns", 3)
UI_CONFIG_VARIABLE (bool, hide_splash_screen, "hide-splash-screen", false)
UI_CONFIG_VARIABLE (bool, use_wm_visibility, "use-wm-visibility", true)
UI_CONFIG_VARIABLE (std::string, stripable_color_palette, "stripable-color-palette", "#AA3939:#FFAAAA:#D46A6A:#801515:#550000:#AA8E39:#FFEAAA:#D4BA6A:#806515:#554000:#343477:#8080B3:#565695:#1A1A59:#09093B:#2D882D:#88CC88:#55AA55:#116611:#004400") /* Gtk::ColorSelection::palette_to_string */
UI_CONFIG_VARIABLE (bool, use_note_bars_for_velocity, "use-note-bars-for-velocity", true)