Fix build with GLib < 2.32

Second part of #1047.
This commit is contained in:
Colomban Wendling 2014-06-04 14:31:12 +02:00
parent ea6ebaf48f
commit c79c983364

View File

@ -3180,17 +3180,16 @@ static gboolean on_sci_key(GtkWidget *widget, GdkEventKey *event, gpointer data)
} }
/* g_signal_handlers_disconnect_by_data is a macro that cannot be used as GCallback */ /* g_signal_handlers_disconnect_by_data is a macro that cannot be used as GCallback */
static gint nonmacro_g_signal_handlers_disconnect_by_data(gpointer instance, gpointer data) static void on_bar_unrealize(GtkWidget *bar, ScintillaObject *sci)
{ {
return g_signal_handlers_disconnect_by_data(instance, data); g_signal_handlers_disconnect_by_func(sci, on_sci_key, bar);
} }
static void enable_key_intercept(GeanyDocument *doc, GtkWidget *bar) static void enable_key_intercept(GeanyDocument *doc, GtkWidget *bar)
{ {
g_signal_connect(doc->editor->sci, "key-press-event", G_CALLBACK(on_sci_key), bar); g_signal_connect(doc->editor->sci, "key-press-event", G_CALLBACK(on_sci_key), bar);
/* make the signal disconnect automatically */ /* make the signal disconnect automatically */
g_signal_connect_swapped(bar, "unrealize", g_signal_connect(bar, "unrealize", G_CALLBACK(on_bar_unrealize), doc->editor->sci);
G_CALLBACK(nonmacro_g_signal_handlers_disconnect_by_data), doc->editor->sci);
} }
static void monitor_reload_file(GeanyDocument *doc) static void monitor_reload_file(GeanyDocument *doc)