summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkstylecontext.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 7eb8d44638..97785f326e 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -762,8 +762,21 @@ create_query_path (GtkStyleContext *context,
priv = context->priv;
path = priv->widget ? _gtk_widget_create_path (priv->widget) : gtk_widget_path_copy (priv->widget_path);
length = gtk_widget_path_length (path);
- if (length > 0)
- style_info_add_to_widget_path (info, path, length - 1);
+ if (gtk_style_context_is_saved (context))
+ {
+ GtkStyleInfo *root = g_slist_last (context->priv->saved_nodes)->data;
+
+ if (length > 0)
+ style_info_add_to_widget_path (root, path, length - 1);
+
+ gtk_widget_path_append_type (path, length > 0 ?gtk_widget_path_iter_get_object_type (path, length - 1) : G_TYPE_NONE);
+ style_info_add_to_widget_path (info, path, length);
+ }
+ else
+ {
+ if (length > 0)
+ style_info_add_to_widget_path (info, path, length - 1);
+ }
return path;
}