summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-05-19 08:36:03 +0200
committerStefano Karapetsas <[email protected]>2014-05-19 08:36:03 +0200
commit99308586f09d0924c5b47987c9aa9bf4654550c5 (patch)
tree49107366652a04047b4548d03444f603b45e076e
parentf751ba1d4f5bf193868997e159828d5c96748662 (diff)
parent51ee7c2bd260221fcb78868ba89fe06e3bb89763 (diff)
downloadmate-desktop-99308586f09d0924c5b47987c9aa9bf4654550c5.tar.bz2
mate-desktop-99308586f09d0924c5b47987c9aa9bf4654550c5.tar.xz
Merge pull request #113 from dnk/may_be_uninitialized
gtk2: warning: cr may be uninitialized
-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);