ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator)
: Dialog (title, modal, use_seperator)
+ , _splash_pushed (false)
{
init ();
}
ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool use_seperator)
: Dialog (title, parent, modal, use_seperator)
+ , _splash_pushed (false)
{
init ();
set_position (Gtk::WIN_POS_CENTER_ON_PARENT);
ArdourDialog::~ArdourDialog ()
{
+ if (_splash_pushed) {
+ Splash* spl = Splash::instance();
+
+ if (spl) {
+ spl->pop_front();
+ }
+ }
}
bool
void
ArdourDialog::on_show ()
{
+ Dialog::on_show ();
+
// never allow the splash screen to obscure any dialog
Splash* spl = Splash::instance();
- if (spl) {
+ if (spl && spl->is_visible()) {
spl->pop_back_for (*this);
+ _splash_pushed = true;
}
-
- Dialog::on_show ();
}
void
#include "ardour/ardour.h"
#include "ardour/filesystem_paths.h"
+#ifdef check
+#undef check
+#endif
+
#include "gui_thread.h"
#include "splash.h"
void
Splash::pop_back_for (Gtk::Window& win)
{
+#ifdef __APPLE__
+ /* 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
+ "level" (e.g. two normal top level windows, or two utility windows) and will not
+ work across them. The splashscreen is on its own "StatusWindowLevel" so restacking
+ is not going to work.
+
+ So for OS X, we just hide ourselves.
+ */
+ hide();
+#else
set_keep_above (false);
get_window()->restack (win.get_window(), false);
- win.signal_hide().connect (sigc::mem_fun (*this, &Splash::pop_front));
+#endif
}
void
Splash::pop_front ()
{
+
+#ifdef __APPLE__
+ if (get_window()) {
+ show ();
+ }
+#else
set_keep_above (true);
+#endif
}
void