parent
ea6ebaf48f
commit
c79c983364
@ -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 */
|
||||
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)
|
||||
{
|
||||
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 */
|
||||
g_signal_connect_swapped(bar, "unrealize",
|
||||
G_CALLBACK(nonmacro_g_signal_handlers_disconnect_by_data), doc->editor->sci);
|
||||
g_signal_connect(bar, "unrealize", G_CALLBACK(on_bar_unrealize), doc->editor->sci);
|
||||
}
|
||||
|
||||
static void monitor_reload_file(GeanyDocument *doc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user