[gtk+] widget: Fix inserting child widgets at the beginning



commit a196ad725a55fa560acf80d2c4a04eff32f33659
Author: Timm Bäder <mail baedert org>
Date:   Fri Sep 29 12:15:23 2017 +0200

    widget: Fix inserting child widgets at the beginning
    
    We have to care about the child widget's current prev/next sibling as
    well.

 gtk/gtkwidget.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 62ae353..d5e65b6 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8310,6 +8310,11 @@ gtk_widget_reposition_after (GtkWidget *widget,
           if (priv->prev_sibling)
             priv->prev_sibling->priv->next_sibling = NULL;
         }
+      if (priv->prev_sibling)
+        priv->prev_sibling->priv->next_sibling = priv->next_sibling;
+
+      if (priv->next_sibling)
+        priv->next_sibling->priv->prev_sibling = priv->prev_sibling;
 
       priv->prev_sibling = NULL;
       priv->next_sibling = parent->priv->first_child;


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