From 51ee7c2bd260221fcb78868ba89fe06e3bb89763 Mon Sep 17 00:00:00 2001 From: Denis Gorodnichev Date: Mon, 19 May 2014 10:21:53 +0400 Subject: gtk2: warning: cr may be uninitialized --- libmate-desktop/mate-colorsel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c index cb27572..8f01a61 100644 --- a/libmate-desktop/mate-colorsel.c +++ b/libmate-desktop/mate-colorsel.c @@ -1159,16 +1159,19 @@ palette_paint (GtkWidget *drawing_area, return; gtk_widget_get_allocation (drawing_area, &allocation); + +#if !GTK_CHECK_VERSION (3, 0, 0) + cr = gdk_cairo_create (gtk_widget_get_window (drawing_area)); +#endif + gdk_cairo_set_source_color (cr, >k_widget_get_style (drawing_area)->bg[GTK_STATE_NORMAL]); #if GTK_CHECK_VERSION (3, 0, 0) cairo_rectangle (cr, 0, 0, allocation.width, allocation.height); #else - cr = gdk_cairo_create (gtk_widget_get_window (drawing_area)); - gdk_cairo_rectangle (cr, area); #endif cairo_fill (cr); - + if (gtk_widget_has_focus (drawing_area)) { set_focus_line_attributes (drawing_area, cr, &focus_width); -- cgit v1.2.1