summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/popup.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gtkmm2ext/popup.cc')
-rw-r--r--libs/gtkmm2ext/popup.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/popup.cc b/libs/gtkmm2ext/popup.cc
index 0b150eefe1..2d586d0317 100644
--- a/libs/gtkmm2ext/popup.cc
+++ b/libs/gtkmm2ext/popup.cc
@@ -22,6 +22,7 @@
#include <gtkmm2ext/popup.h>
#include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/gtk_ui.h>
using namespace std;
using namespace Gtk;
@@ -83,9 +84,17 @@ PopUp::remove ()
}
}
+#define ENSURE_GUI_THREAD(slot) \
+ if (!Gtkmm2ext::UI::instance()->caller_is_ui_thread()) {\
+ Gtkmm2ext::UI::instance()->call_slot ((slot));\
+ return;\
+ }
+
void
PopUp::touch ()
{
+ ENSURE_GUI_THREAD (mem_fun (*this, &PopUp::touch));
+
if (is_visible ()) {
remove ();
} else {