]> Pileus Git - ~andy/gtk/commitdiff
gtk: save/restore the cairo_t around early upchaining in draw()
authorMichael Natterer <mitch@gimp.org>
Fri, 21 Jan 2011 14:06:43 +0000 (15:06 +0100)
committerMichael Natterer <mitch@gimp.org>
Fri, 21 Jan 2011 14:06:43 +0000 (15:06 +0100)
and don't save/restore the style context because that's the job of
each draw() implementation.

gtk/gtkspinbutton.c

index e31796855dddaeada565be8792c8b1aa6d50cfc4..1d357e38ae9664f0e733d78bbaf948d9b8acfa22 100644 (file)
@@ -921,12 +921,10 @@ gtk_spin_button_draw (GtkWidget      *widget,
 
   is_rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
   context = gtk_widget_get_style_context (widget);
-  gtk_style_context_save (context);
-
-  GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->draw (widget, cr);
 
-  gtk_style_context_restore (context);
   cairo_save (cr);
+  GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->draw (widget, cr);
+  cairo_restore (cr);
 
   state = gtk_widget_get_state_flags (widget);
 
@@ -953,7 +951,6 @@ gtk_spin_button_draw (GtkWidget      *widget,
   gtk_spin_button_draw_arrow (spin, context, cr, GTK_ARROW_DOWN);
 
   gtk_style_context_restore (context);
-  cairo_restore (cr);
 
   return FALSE;
 }