make Gtkmm2ext::Popup::touch() thread-safe (again; it used to be in the 0.99 era)

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4258 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-11-25 22:15:19 +00:00
parent cadaf74a80
commit 35b218b527
1 changed files with 9 additions and 0 deletions

View File

@ -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 {