From a08c14ba6bf29d50d6fdda1e159b1be8ca8bdbdc Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 5 Nov 2013 19:49:37 +0100 Subject: [PATCH] taglist: Fix tags loading with GTK3 --- plugins/taglist/pluma-taglist-plugin-panel.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/taglist/pluma-taglist-plugin-panel.c b/plugins/taglist/pluma-taglist-plugin-panel.c index a8d8473..26ea0d4 100755 --- a/plugins/taglist/pluma-taglist-plugin-panel.c +++ b/plugins/taglist/pluma-taglist-plugin-panel.c @@ -592,8 +592,13 @@ tags_list_query_tooltip_cb (GtkWidget *widget, } static gboolean +#if GTK_CHECK_VERSION (3, 0, 0) +draw_event_cb (GtkWidget *panel, + cairo_t *cr, +#else expose_event_cb (GtkWidget *panel, GdkEventExpose *event, +#endif gpointer user_data) { PlumaTaglistPluginPanel *ppanel = PLUMA_TAGLIST_PLUGIN_PANEL (panel); @@ -607,8 +612,13 @@ expose_event_cb (GtkWidget *panel, /* And populate combo box */ populate_tag_groups_combo (PLUMA_TAGLIST_PLUGIN_PANEL (panel)); +#if GTK_CHECK_VERSION (3, 0, 0) + /* We need to manage only the first draw -> disconnect */ + g_signal_handlers_disconnect_by_func (panel, draw_event_cb, NULL); +#else /* We need to manage only the first expose event -> disconnect */ g_signal_handlers_disconnect_by_func (panel, expose_event_cb, NULL); +#endif return FALSE; } @@ -775,8 +785,13 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel) G_CALLBACK (selected_group_changed), panel); g_signal_connect (panel, +#if GTK_CHECK_VERSION (3, 0, 0) + "draw", + G_CALLBACK (draw_event_cb), +#else "expose-event", G_CALLBACK (expose_event_cb), +#endif NULL); }