[gnome-builder] libide/tweaks: root bindings when necessary



commit 203b53465f019786e366f93774595010e1196fbb
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 24 10:53:15 2022 -0700

    libide/tweaks: root bindings when necessary

 src/libide/tweaks/ide-tweaks-widget.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/tweaks/ide-tweaks-widget.c b/src/libide/tweaks/ide-tweaks-widget.c
index b6f2e6db3..be4f79ec6 100644
--- a/src/libide/tweaks/ide-tweaks-widget.c
+++ b/src/libide/tweaks/ide-tweaks-widget.c
@@ -256,5 +256,12 @@ ide_tweaks_widget_set_binding (IdeTweaksWidget  *self,
   g_return_if_fail (!binding || IDE_IS_TWEAKS_BINDING (binding));
 
   if (g_set_object (&priv->binding, binding))
-    g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BINDING]);
+    {
+      /* Root the binding if necessary */
+      if (binding != NULL && ide_tweaks_item_get_parent (IDE_TWEAKS_ITEM (binding)))
+        ide_tweaks_item_insert_after (IDE_TWEAKS_ITEM (binding),
+                                      IDE_TWEAKS_ITEM (self),
+                                      NULL);
+      g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BINDING]);
+    }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]