summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
authorDenis Gorodnichev <[email protected]>2014-05-19 10:21:53 +0400
committerDenis Gorodnichev <[email protected]>2014-05-19 10:21:53 +0400
commit51ee7c2bd260221fcb78868ba89fe06e3bb89763 (patch)
treeffeeb04f91317372530938387fa8469ea25d6cb3 /libmate-desktop
parent99d35bbbabfb135a5597d5f4b2a0daf92efa99dc (diff)
downloadmate-desktop-51ee7c2bd260221fcb78868ba89fe06e3bb89763.tar.bz2
mate-desktop-51ee7c2bd260221fcb78868ba89fe06e3bb89763.tar.xz
gtk2: warning: cr may be uninitialized
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-colorsel.c9
1 files 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, &gtk_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);