Prevent possible endless loop in Splash::display() and handle
some related edge-cases and race conditions WRT expose_done
and is_visible().
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
- if (splash && splash->is_visible()) {
// in 1 second, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
}
// in 1 second, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
}
- if (splash && splash->is_visible()) {
// in 1 second, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
}
// in 1 second, hide the splash screen
Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 1000);
}
#include "pbd/failed_constructor.h"
#include "pbd/file_utils.h"
#include "pbd/failed_constructor.h"
#include "pbd/file_utils.h"
+#include "pbd/stacktrace.h"
#include "ardour/ardour.h"
#include "ardour/filesystem_paths.h"
#include "ardour/ardour.h"
#include "ardour/filesystem_paths.h"
+ idle_connection.disconnect ();
+ expose_done = true;
+ hide ();
void
Splash::pop_front ()
{
void
Splash::pop_front ()
{
-#if defined __APPLE__ || defined PLATFORM_WINDOWS
+#if defined __APPLE__ || defined PLATFORM_WINDOWS
+#else
+ gdk_window_restack(get_window()->gobj(), NULL, true);
+ }
+}
+
+void
+Splash::hide ()
+{
+ Gtk::Window::hide();
*/
if (expose_is_the_one) {
*/
if (expose_is_the_one) {
- Glib::signal_idle().connect (sigc::mem_fun (this, &Splash::idle_after_expose),
- GDK_PRIORITY_REDRAW+2);
+ idle_connection = Glib::signal_idle().connect (
+ sigc::mem_fun (this, &Splash::idle_after_expose),
+ GDK_PRIORITY_REDRAW+2);
present ();
if (!was_mapped) {
present ();
if (!was_mapped) {
+ while (!expose_done && gtk_events_pending()) {
gtk_main_iteration ();
}
gdk_display_flush (gdk_display_get_default());
gtk_main_iteration ();
}
gdk_display_flush (gdk_display_get_default());
Glib::RefPtr<Gdk::Window> win = darea.get_window();
if (win) {
Glib::RefPtr<Gdk::Window> win = darea.get_window();
if (win) {
if (win->is_visible ()) {
win->invalidate_rect (Gdk::Rectangle (0, darea.get_height() - 30, darea.get_width(), 30), true);
} else {
darea.queue_draw ();
}
if (win->is_visible ()) {
win->invalidate_rect (Gdk::Rectangle (0, darea.get_height() - 30, darea.get_width(), 30), true);
} else {
darea.queue_draw ();
}
+ if (expose_done) {
+ ARDOUR::GUIIdle ();
+ }
void on_realize ();
bool on_map_event (GdkEventAny*);
void message (const std::string& msg);
void on_realize ();
bool on_map_event (GdkEventAny*);
void message (const std::string& msg);
private:
static Splash* the_splash;
private:
static Splash* the_splash;
void boot_message (std::string);
PBD::ScopedConnection msg_connection;
void boot_message (std::string);
PBD::ScopedConnection msg_connection;
+ sigc::connection idle_connection;
+ volatile bool expose_done;
bool expose_is_the_one;
bool idle_after_expose ();
};
bool expose_is_the_one;
bool idle_after_expose ();
};