taglist: Fix tags loading with GTK3

This commit is contained in:
Stefano Karapetsas 2013-11-05 19:49:37 +01:00
parent 76265841b7
commit a08c14ba6b
1 changed files with 15 additions and 0 deletions

View File

@ -592,8 +592,13 @@ tags_list_query_tooltip_cb (GtkWidget *widget,
} }
static gboolean static gboolean
#if GTK_CHECK_VERSION (3, 0, 0)
draw_event_cb (GtkWidget *panel,
cairo_t *cr,
#else
expose_event_cb (GtkWidget *panel, expose_event_cb (GtkWidget *panel,
GdkEventExpose *event, GdkEventExpose *event,
#endif
gpointer user_data) gpointer user_data)
{ {
PlumaTaglistPluginPanel *ppanel = PLUMA_TAGLIST_PLUGIN_PANEL (panel); PlumaTaglistPluginPanel *ppanel = PLUMA_TAGLIST_PLUGIN_PANEL (panel);
@ -607,8 +612,13 @@ expose_event_cb (GtkWidget *panel,
/* And populate combo box */ /* And populate combo box */
populate_tag_groups_combo (PLUMA_TAGLIST_PLUGIN_PANEL (panel)); 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 */ /* We need to manage only the first expose event -> disconnect */
g_signal_handlers_disconnect_by_func (panel, expose_event_cb, NULL); g_signal_handlers_disconnect_by_func (panel, expose_event_cb, NULL);
#endif
return FALSE; return FALSE;
} }
@ -775,8 +785,13 @@ pluma_taglist_plugin_panel_init (PlumaTaglistPluginPanel *panel)
G_CALLBACK (selected_group_changed), G_CALLBACK (selected_group_changed),
panel); panel);
g_signal_connect (panel, g_signal_connect (panel,
#if GTK_CHECK_VERSION (3, 0, 0)
"draw",
G_CALLBACK (draw_event_cb),
#else
"expose-event", "expose-event",
G_CALLBACK (expose_event_cb), G_CALLBACK (expose_event_cb),
#endif
NULL); NULL);
} }