From ec3c49f612d9fcbabd855c0847935ac5b9573499 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 3 Aug 2019 22:12:36 +0200 Subject: [PATCH] Investigation: can reproduce the problematic behaviour with minimal setup when we create a new Gtk::StyleContext and just apply a path, then the style context looses its styling properties on context_save() --- research/gtk-style-experiment.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/research/gtk-style-experiment.cpp b/research/gtk-style-experiment.cpp index e6873acdb..ffc11f85c 100644 --- a/research/gtk-style-experiment.cpp +++ b/research/gtk-style-experiment.cpp @@ -214,7 +214,11 @@ namespace research { Gtk::StyleContext::add_provider_for_screen (screen, css_provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - auto style = srcWidget.get_style_context(); +// auto style = srcWidget.get_style_context(); + + Gtk::WidgetPath path = srcWidget.get_path(); + PStyleContext style = Gtk::StyleContext::create(); + style->set_path(path); // style->add_class(slopeClassName(2)); return style; }