Rename import_audiofiles -> import_files.
[ardour.git] / libs / gtkmm2ext / popup.cc
index 0b150eefe119b1dbd6a264cfb39ea26377ae4059..6f4a8a5427d3372d6787098a08b92aac7103bc80 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <gtkmm2ext/popup.h>
 #include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/gtk_ui.h>
 
 using namespace std;
 using namespace Gtk;
@@ -79,13 +80,21 @@ PopUp::remove ()
 
        if (delete_on_hide) {
                std::cerr << "deleting prompter\n";
-               gtk_idle_add (idle_delete, this);
+               g_idle_add (idle_delete, this);
        }
 }
+#define ENSURE_GUI_THREAD(slot) \
+     if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {\
+             Gtkmm2ext::UI::instance()->call_slot (MISSING_INVALIDATOR, (slot)); \
+        return;\
+     }
+
 
 void
 PopUp::touch ()
 {
+       ENSURE_GUI_THREAD (mem_fun (*this, &PopUp::touch));
+
        if (is_visible ()) {
                remove ();
        } else {
@@ -102,7 +111,7 @@ PopUp::touch ()
 }
 
 gint
-PopUp::button_click (GdkEventButton *ev)
+PopUp::button_click (GdkEventButton */*ev*/)
 {
        remove ();
        return TRUE;
@@ -122,7 +131,7 @@ PopUp::set_name (string name)
 }
 
 bool
-PopUp::on_delete_event (GdkEventAny* ev)
+PopUp::on_delete_event (GdkEventAny* /*ev*/)
 {
        hide();