forked from AuroraMiddleware/gtk
GDK W32: Deduplicate reparenting
gdk_window_reparent() already changes children list for old and new parent. Doing so twice results in a circular reference in the list, which can hang the application later, for example in gtk_window_show(). https://bugzilla.gnome.org/show_bug.cgi?id=764845
This commit is contained in:
parent
c8d1108574
commit
c2aa7d0749
@ -1662,8 +1662,6 @@ gdk_win32_window_reparent (GdkWindow *window,
|
||||
gint y)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
GdkWindow *parent;
|
||||
GdkWindow *old_parent;
|
||||
GdkWindowImplWin32 *impl;
|
||||
gboolean new_parent_is_root;
|
||||
gboolean was_toplevel;
|
||||
@ -1679,8 +1677,6 @@ gdk_win32_window_reparent (GdkWindow *window,
|
||||
else
|
||||
new_parent_is_root = (gdk_screen_get_root_window (screen) == new_parent);
|
||||
|
||||
old_parent = window->parent;
|
||||
parent = new_parent;
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
GDK_NOTE (MISC, g_print ("gdk_win32_window_reparent: %p: %p\n",
|
||||
@ -1745,11 +1741,6 @@ gdk_win32_window_reparent (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (old_parent)
|
||||
old_parent->children = g_list_remove_link (old_parent->children, &window->children_list_node);
|
||||
|
||||
parent->children = g_list_concat (&window->children_list_node, parent->children);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user