[gtk+] GtkColorSwatch: Avoid style context underflow
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkColorSwatch: Avoid style context underflow
- Date: Sun, 12 Oct 2014 22:19:17 +0000 (UTC)
commit e1ff15549b52f47b42fb128011f9493eb8a71f43
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 12 18:15:23 2014 -0400
GtkColorSwatch: Avoid style context underflow
The last change accidentally removed the later restore, and
left the earlier, so we ended up with a restore-save sequence.
Thankfully, GtkStyleContext warns about this.
gtk/gtkcolorswatch.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index a88ce46..b3459a7 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -183,8 +183,6 @@ swatch_draw (GtkWidget *widget,
g_object_unref (gicon);
}
- gtk_style_context_restore (context);
-
/* now draw the overlay image */
gtk_style_context_get_border (context, state, &border);
gtk_style_context_get_padding (context, state, &padding);
@@ -222,6 +220,8 @@ swatch_draw (GtkWidget *widget,
gtk_render_focus (context, cr, 0, 0, width, height);
}
+ gtk_style_context_restore (context);
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]