[gtk/wip/baedert/nodeeditor: 19/42] rendernodeparser: Don't add single nodes to a container node
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/nodeeditor: 19/42] rendernodeparser: Don't add single nodes to a container node
- Date: Wed, 24 Apr 2019 11:38:44 +0000 (UTC)
commit e708ce801f2c096e0eb7eb1e3c199703edb78db4
Author: Timm Bäder <mail baedert org>
Date: Tue Apr 23 17:52:28 2019 +0200
rendernodeparser: Don't add single nodes to a container node
gsk/gskrendernodeparser.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index ed7c60feaf..66fa9156e6 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -963,6 +963,15 @@ gsk_render_node_deserialize_from_bytes (GBytes *bytes)
parser = gtk_css_parser_new_for_bytes (bytes, NULL, NULL, gsk_render_node_parser_error, NULL, NULL);
root = parse_container_node (parser);
+ if (gsk_container_node_get_n_children (root) == 1)
+ {
+ GskRenderNode *child = gsk_container_node_get_child (root, 0);
+
+ gsk_render_node_ref (child);
+ gsk_render_node_unref (root);
+ root = child;
+ }
+
gtk_css_parser_unref (parser);
return root;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]