diff options
Diffstat (limited to 'gtk2_ardour/splash.cc')
-rw-r--r-- | gtk2_ardour/splash.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 5643adbd6a..cd09be0574 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -85,6 +85,40 @@ Splash::~Splash () the_splash = 0; } +bool +Splash::wakeup_from_splash_sleep () +{ + splash_done_visible = true; + return false; +} + +bool +Splash::splash_mapped (GdkEventAny*) +{ + Glib::signal_idle().connect (sigc::mem_fun (this, &Splash::wakeup_from_splash_sleep)); + return false; +} + +void +Splash::display () +{ + bool was_mapped = is_mapped (); + + if (!was_mapped) { + signal_map_event().connect (sigc::mem_fun (this, &Splash::splash_mapped), false); + splash_done_visible = false; + } + + pop_front (); + present (); + + if (!was_mapped) { + while (!splash_done_visible) { + gtk_main_iteration (); + } + } +} + void Splash::pop_back_for (Gtk::Window& win) { |