After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 120077 - Problems with toplevels and reparenting
Problems with toplevels and reparenting
Status: RESOLVED DUPLICATE of bug 117579
Product: gtk+
Classification: Platform
Component: Backend: X11
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-08-17 17:09 UTC by Soren Sandmann Pedersen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.63 KB, patch)
2003-08-17 17:10 UTC, Soren Sandmann Pedersen
none Details | Review

Description Soren Sandmann Pedersen 2003-08-17 17:09:18 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.
Comment 1 Soren Sandmann Pedersen 2003-08-17 17:10:51 UTC
Created attachment 19291 [details] [review]
patch
Comment 2 Owen Taylor 2003-08-17 18:07:04 UTC
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 ***