From 8760b08f28f44f46edcca119fef1f768a93267bd Mon Sep 17 00:00:00 2001 From: Monsta Date: Mon, 2 Nov 2015 22:00:29 +0300 Subject: refactor draw/expose code a bit and set the correct return type --- libmate-desktop/mate-colorbutton.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'libmate-desktop') diff --git a/libmate-desktop/mate-colorbutton.c b/libmate-desktop/mate-colorbutton.c index ff62e16..2f65e64 100644 --- a/libmate-desktop/mate-colorbutton.c +++ b/libmate-desktop/mate-colorbutton.c @@ -257,26 +257,24 @@ mate_color_button_get_checkered (void) } /* Handle exposure events for the color picker's drawing area */ -#if GTK_CHECK_VERSION (3, 0, 0) static gboolean +#if GTK_CHECK_VERSION (3, 0, 0) draw (GtkWidget *widget, cairo_t *cr, gpointer data) #else -static gint expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer data) #endif { MateColorButton *color_button = MATE_COLOR_BUTTON (data); - GtkAllocation allocation; cairo_pattern_t *checkered; -#if !GTK_CHECK_VERSION (3, 0, 0) - cairo_t *cr; - cr = gdk_cairo_create (event->window); +#if !GTK_CHECK_VERSION (3, 0, 0) + cairo_t *cr = gdk_cairo_create (event->window); + GtkAllocation allocation; gtk_widget_get_allocation (widget, &allocation); gdk_cairo_rectangle (cr, &allocation); cairo_clip (cr); -- cgit v1.2.1