Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 301143 | Differences between
and this patch

Collapse All | Expand All

(-)/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/app.cpp (-6 / +13 lines)
Lines 150-156 Link Here
150
// This will be called when the "event" signal is issued on any GtkWidget object.
150
// This will be called when the "event" signal is issued on any GtkWidget object.
151
static gboolean
151
static gboolean
152
event_emission_hook(GSignalInvocationHint*, guint, const GValue*, gpointer)
152
event_emission_hook(GSignalInvocationHint*, guint, const GValue*, gpointer data)
153
{
153
{
154
    wxapp_install_idle_handler();
154
    wxapp_install_idle_handler();
155
    bool* hook_installed = (bool*)data;
156
    *hook_installed = false;
155
    // remove hook
157
    // remove hook
156
    return false;
158
    return false;
Lines 160-169 Link Here
160
static inline void wxAddEmissionHook()
162
static inline void wxAddEmissionHook()
161
{
163
{
164
    static bool hook_installed;
162
    GType widgetType = GTK_TYPE_WIDGET;
165
    GType widgetType = GTK_TYPE_WIDGET;
163
    // if GtkWidget type is loaded
166
    // if hook not installed and GtkWidget type is loaded
164
    if (g_type_class_peek(widgetType) != NULL)
167
    if (!hook_installed && g_type_class_peek(widgetType))
165
    {
168
    {
166
        guint sig_id = g_signal_lookup("event", widgetType);
169
        static guint sig_id;
167
        g_signal_add_emission_hook(sig_id, 0, event_emission_hook, NULL, NULL);
170
        if (sig_id == 0)
171
            sig_id = g_signal_lookup("event", widgetType);
172
        hook_installed = true;
173
        g_signal_add_emission_hook(
174
            sig_id, 0, event_emission_hook, &hook_installed, NULL);
168
    }
175
    }
169
}
176
}

Return to bug 301143