|
Dan Horák |
178616 |
Index: src/gtk/app.cpp
|
|
Dan Horák |
178616 |
===================================================================
|
|
Dan Horák |
178616 |
--- src/gtk/app.cpp (revision 62396)
|
|
Dan Horák |
178616 |
+++ src/gtk/app.cpp (revision 62397)
|
|
Dan Horák |
178616 |
@@ -149,9 +149,11 @@
|
|
Dan Horák |
178616 |
// One-shot emission hook for "event" signal, to install idle handler.
|
|
Dan Horák |
178616 |
// This will be called when the "event" signal is issued on any GtkWidget object.
|
|
Dan Horák |
178616 |
static gboolean
|
|
Dan Horák |
178616 |
-event_emission_hook(GSignalInvocationHint*, guint, const GValue*, gpointer)
|
|
Dan Horák |
178616 |
+event_emission_hook(GSignalInvocationHint*, guint, const GValue*, gpointer data)
|
|
Dan Horák |
178616 |
{
|
|
Dan Horák |
178616 |
wxapp_install_idle_handler();
|
|
Dan Horák |
178616 |
+ bool* hook_installed = (bool*)data;
|
|
Dan Horák |
178616 |
+ *hook_installed = false;
|
|
Dan Horák |
178616 |
// remove hook
|
|
Dan Horák |
178616 |
return false;
|
|
Dan Horák |
178616 |
}
|
|
Dan Horák |
178616 |
@@ -159,12 +161,17 @@
|
|
Dan Horák |
178616 |
// add emission hook for "event" signal, to re-install idle handler when needed
|
|
Dan Horák |
178616 |
static inline void wxAddEmissionHook()
|
|
Dan Horák |
178616 |
{
|
|
Dan Horák |
178616 |
+ static bool hook_installed;
|
|
Dan Horák |
178616 |
GType widgetType = GTK_TYPE_WIDGET;
|
|
Dan Horák |
178616 |
- // if GtkWidget type is loaded
|
|
Dan Horák |
178616 |
- if (g_type_class_peek(widgetType) != NULL)
|
|
Dan Horák |
178616 |
+ // if hook not installed and GtkWidget type is loaded
|
|
Dan Horák |
178616 |
+ if (!hook_installed && g_type_class_peek(widgetType))
|
|
Dan Horák |
178616 |
{
|
|
Dan Horák |
178616 |
- guint sig_id = g_signal_lookup("event", widgetType);
|
|
Dan Horák |
178616 |
- g_signal_add_emission_hook(sig_id, 0, event_emission_hook, NULL, NULL);
|
|
Dan Horák |
178616 |
+ static guint sig_id;
|
|
Dan Horák |
178616 |
+ if (sig_id == 0)
|
|
Dan Horák |
178616 |
+ sig_id = g_signal_lookup("event", widgetType);
|
|
Dan Horák |
178616 |
+ hook_installed = true;
|
|
Dan Horák |
178616 |
+ g_signal_add_emission_hook(
|
|
Dan Horák |
178616 |
+ sig_id, 0, event_emission_hook, &hook_installed, NULL);
|
|
Dan Horák |
178616 |
}
|
|
Dan Horák |
178616 |
}
|
|
Dan Horák |
178616 |
|