Save and restore GtkStyleContext in a few places that were not doing it

Does not fix any known problem, but seems prudent

(backport of 5d04f41d47)
This commit is contained in:
Paul Cornett
2016-08-31 10:39:57 -07:00
parent ed54a746b0
commit 786f778b71
2 changed files with 6 additions and 0 deletions

View File

@@ -304,8 +304,10 @@ draw_border(GtkWidget* widget, GdkEventExpose* gdk_event, wxWindow* win)
#ifdef __WXGTK3__
GtkStyleContext* sc = gtk_widget_get_style_context(win->m_wxwindow);
GdkRGBA c;
gtk_style_context_save(sc);
gtk_style_context_set_state(sc, GTK_STATE_FLAG_NORMAL);
gtk_style_context_get_border_color(sc, GTK_STATE_FLAG_NORMAL, &c);
gtk_style_context_restore(sc);
gdk_cairo_set_source_rgba(cr, &c);
cairo_set_line_width(cr, 1);
cairo_rectangle(cr, x + 0.5, y + 0.5, w - 1, h - 1);
@@ -4444,9 +4446,11 @@ void wxWindowGTK::GTKApplyStyle(GtkWidget* widget, GtkRcStyle* WXUNUSED_IN_GTK3(
cairo_pattern_t* pattern = NULL;
if (m_backgroundColour.IsOk())
{
gtk_style_context_save(context);
gtk_style_context_set_state(context, GTK_STATE_FLAG_NORMAL);
gtk_style_context_get(context,
GTK_STATE_FLAG_NORMAL, "background-image", &pattern, NULL);
gtk_style_context_restore(context);
}
if (pattern)
{