From 8cbaee47a04acf2af66a2d02dca9d3d91a2f2ecc Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 24 Oct 2010 21:26:18 +0200 Subject: [PATCH] Use correct signature and connection function for ::draw In ui/fixedtip.c, use g_signal_connect instead of g_signal_connect_swapped since we're not using the data pointer (and for clarity). At the same time, ensure that both the GTK2 and the GTK3 code paths have the correct signature for the handler. https://bugzilla.gnome.org/show_bug.cgi?id=633051 --- src/ui/fixedtip.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ui/fixedtip.c b/src/ui/fixedtip.c index e006e8c07..0afc8c6a8 100644 --- a/src/ui/fixedtip.c +++ b/src/ui/fixedtip.c @@ -55,21 +55,24 @@ static int screen_bottom_edge = 0; #ifdef USE_GTK3 static gboolean draw_handler (GtkWidget *tooltips, - cairo_t *cr) + cairo_t *cr, + gpointer user_data) { gtk_paint_flat_box (gtk_widget_get_style (tip), cr, GTK_STATE_NORMAL, GTK_SHADOW_OUT, tip, "tooltip", 0, 0, - gtk_widget_get_allocated_width (tooltips), - gtk_widget_get_allocated_height (tooltips)); + gtk_widget_get_allocated_width (tip), + gtk_widget_get_allocated_height (tip)); return FALSE; } #else /* !USE_GTK3 */ static gint -expose_handler (GtkWidget *tooltips) +expose_handler (GtkWidget *tooltips, + GdkEventExpose *event, + gpointer user_data) { gtk_paint_flat_box (gtk_widget_get_style (tip), gtk_widget_get_window (tip), @@ -114,11 +117,11 @@ meta_fixed_tip_show (Display *xdisplay, int screen_number, gtk_container_set_border_width (GTK_CONTAINER (tip), 4); #ifdef USE_GTK3 - g_signal_connect_swapped (tip, "draw", - G_CALLBACK (draw_handler), NULL); + g_signal_connect (tip, "draw", + G_CALLBACK (draw_handler), NULL); #else - g_signal_connect_swapped (tip, "expose_event", - G_CALLBACK (expose_handler), NULL); + g_signal_connect (tip, "expose_event", + G_CALLBACK (expose_handler), NULL); #endif label = gtk_label_new (NULL);