summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2014-12-14 23:05:17 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2015-01-09 11:50:38 +0000
commit11892d78aef7090b107c897cab46b2540104f5a7 (patch)
tree966339f5218696936d8ad730a8dcb9c6145f8f1e
parent55093719a3d2b9b9876832d250e998fa153ef304 (diff)
downloadclutter-11892d78aef7090b107c897cab46b2540104f5a7.tar.gz
script: Do not overwrite ObjectInfo fields
When merging multiple definitions it's possible that the ObjectInfo fields may get overwritten. Instead of trampling over the fields, we should reset them only when they actually change — especially the "is_actor" one, which controls the destruction of the objects when unmerging happens. https://bugzilla.gnome.org/show_bug.cgi?id=669743 (cherry picked from commit d005c6a8809fe48ce5c8e5a9f0f620e4f60bb7e6) Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
-rw-r--r--clutter/clutter-script-parser.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c
index 3ed900cb2..161103734 100644
--- a/clutter/clutter-script-parser.c
+++ b/clutter/clutter-script-parser.c
@@ -1083,6 +1083,7 @@ clutter_script_parser_object_end (JsonParser *json_parser,
oinfo = g_slice_new0 (ObjectInfo);
oinfo->merge_id = _clutter_script_get_last_merge_id (script);
oinfo->id = g_strdup (id_);
+ oinfo->has_unresolved = TRUE;
class_name = json_object_get_string_member (object, "type");
oinfo->class_name = g_strdup (class_name);
@@ -1107,6 +1108,8 @@ clutter_script_parser_object_end (JsonParser *json_parser,
oinfo->children = parse_children (oinfo, val);
json_object_remove_member (object, "children");
+
+ oinfo->has_unresolved = TRUE;
}
if (json_object_has_member (object, "signals"))
@@ -1115,9 +1118,9 @@ clutter_script_parser_object_end (JsonParser *json_parser,
oinfo->signals = parse_signals (script, oinfo, val);
json_object_remove_member (object, "signals");
- }
- oinfo->is_actor = FALSE;
+ oinfo->has_unresolved = TRUE;
+ }
if (strcmp (oinfo->class_name, "ClutterStage") == 0 &&
json_object_has_member (object, "is-default"))
@@ -1132,9 +1135,6 @@ clutter_script_parser_object_end (JsonParser *json_parser,
else
oinfo->is_stage_default = FALSE;
- oinfo->is_unmerged = FALSE;
- oinfo->has_unresolved = TRUE;
-
members = json_object_get_members (object);
for (l = members; l; l = l->next)
{
@@ -1175,6 +1175,7 @@ clutter_script_parser_object_end (JsonParser *json_parser,
pinfo->is_layout = g_str_has_prefix (name, "layout::") ? TRUE : FALSE;
oinfo->properties = g_list_prepend (oinfo->properties, pinfo);
+ oinfo->has_unresolved = TRUE;
}
g_list_free (members);
@@ -2169,12 +2170,12 @@ _clutter_script_construct_object (ClutterScript *script,
if (G_UNLIKELY (oinfo->gtype == G_TYPE_INVALID))
return;
-
- oinfo->is_actor = g_type_is_a (oinfo->gtype, CLUTTER_TYPE_ACTOR);
- if (oinfo->is_actor)
- oinfo->is_stage = g_type_is_a (oinfo->gtype, CLUTTER_TYPE_STAGE);
}
+ oinfo->is_actor = g_type_is_a (oinfo->gtype, CLUTTER_TYPE_ACTOR);
+ if (oinfo->is_actor)
+ oinfo->is_stage = g_type_is_a (oinfo->gtype, CLUTTER_TYPE_STAGE);
+
if (oinfo->is_stage && oinfo->is_stage_default)
{
ClutterStageManager *manager = clutter_stage_manager_get_default ();