From 2fa6f32d8e26a04ecc7fc399241916d0bfbf5034 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Sun, 7 Dec 2008 13:42:19 +0100 Subject: [PATCH] When reparenting, remove from old parent before setting the new parent (otherwise we remove from the wrong parent) --- gdk/gdkwindow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 381ce0de94..a95d69b0d0 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -973,13 +973,13 @@ gdk_window_reparent (GdkWindow *window, new_parent_private = (GdkWindowObject *)new_parent; } + if (private->parent) + private->parent->children = g_list_remove (private->parent->children, window); + private->parent = new_parent_private; private->x = x; private->y = y; - if (private->parent) - private->parent->children = g_list_remove (private->parent->children, window); - new_parent_private->children = g_list_prepend (new_parent_private->children, window); /* Switch the window type as appropriate */