Copy and pasting messes references between widgets
This is something I noticed many times when adding new parents to a complex widgets trees, e.g.
- Cut a child widget that contains non-trivial widgets tree
- Replace that children with a Box
- Paste the cut child into the Box
- Export all
You will see something like this:
<property name="title-widget">
<object class="AdwViewSwitcher">
<property name="policy">wide</property>
- <property name="stack">stack</property>
+ <property name="stack">3</property>
</object>
</property>
<child type="end">
<object class="GtkMenuButton">
<property name="icon-name">open-menu-symbolic</property>
- <property name="popover">popover</property>
+ <property name="popover">23</property>
</object>
</child>
</object>
@@ -118,6 +122,6 @@
</item>
</menu>
<object class="GtkPopoverMenu" id="popover">
- <property name="menu-model">menu</property>
+ <property name="menu-model">19</property>
</object>
</interface>
Which manifests later on runtime with
Error building template class 'Window' for an instance of type 'Window': .:0:0 Object with ID 3 not found
This can be reproduced on
$ flatpak info ar.xjuan.Cambalache
Cambalache - Create GTK User Interfaces
ID: ar.xjuan.Cambalache
Ref: app/ar.xjuan.Cambalache/x86_64/stable
Arch: x86_64
Branch: stable
Version: 0.16.0
License: LGPL-2.1
Origin: flathub
Collection: org.flathub.Stable
Installation: user
Installed: 13.9 MB
Runtime: org.gnome.Platform/x86_64/45
Sdk: org.gnome.Sdk/x86_64/45
Commit: 337c69a93d2dc80212b0d882edfb3a7737633dc9e78f9a97c8158b1c5f2c4f88
Parent: 86f89580e0d9a14ff3aefa26f23788ec1dd6e8796a46fc23bb37774abec34d92
Subject: Bump to 0.16.0 (dd40049a)