GNOME Bugzilla – Bug 120077
Problems with toplevels and reparenting
Last modified: 2004-12-22 21:47:04 UTC
In gdk_window_reparent() this happens when a window is reparented from being a toplevel to become a child: if (impl->toplevel) { gdk_toplevel_x11_free_contents (impl->toplevel); g_free (impl->toplevel); impl->toplevel = NULL; } This is a problem, because at this points toplevel->focus_window is still in the XID->Gdk map, and that map stores the _location_ of the XID. So freeing the location here without first removing the XID from the table is wrong. The attached patch works for me, but I'm not sure I understand this code. Shouldn't the focus window be re-created and the window type adjusted when a window is reparented so that it becomes a toplevel.
Created attachment 19291 [details] [review] patch
Yes, more is needed, the toplevel structure at least needs to be created and destroyed on reparent; it may be that we also need to set more properties on the toplevel than we do currently. *** This bug has been marked as a duplicate of 117579 ***