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 167259 - reparenting of GtkEntry and GtkSpinButton breaks
reparenting of GtkEntry and GtkSpinButton breaks
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-02-13 13:24 UTC by Christian Persch
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase.c (2.51 KB, text/plain)
2005-02-13 13:25 UTC, Christian Persch
  Details
a patch (959 bytes, patch)
2005-02-21 07:27 UTC, Matthias Clasen
none Details | Review

Description Christian Persch 2005-02-13 13:24:30 UTC
Reparenting a GtkEntry into a hidden container will still show the entry, in a
wrong place.

Steps to reproduce:
0) Compile & run attached testcase
1) Click "Reparent to popup" button
2) Click "Reparent from popup" button
3) Toggle "Show entry box" button off
4) Repeat 1) and 2)

Expected results:
After step 4, the entry is hidden since it's inside a hidden box.

Actual results:
After step 4, the entry shows at the upper left corner of the window. If I
toggle the "Show entry box" button on again, it moves to its correct place.

If I replace the GtkEntry with a GtkSpinButton (commented out in the testcase
code), it will lose its spin arrows after step 2, and also show its entry after
step 4. Hiding and showing it will not give me the arrows back.

This may have something to do with bug 50279, but that was supposedly fixed a
long time ago...
Comment 1 Christian Persch 2005-02-13 13:25:08 UTC
Created attachment 37429 [details]
testcase.c
Comment 2 Christian Persch 2005-02-13 13:30:36 UTC
If I use a GtkFrame as the entry's container, it still breaks. However, if I use
a GtkEventBox, it works as expected.
Comment 3 Matthias Clasen 2005-02-21 07:27:16 UTC
Created attachment 37734 [details] [review]
a patch

Here is a patch which fixes the problem of the spinbutton loosing its arrows.
It doesn't fix the problem when reparenting into a hidden box.
Comment 4 Matthias Clasen 2005-02-24 16:44:14 UTC
2005-02-24  Matthias Clasen  <mclasen@redhat.com>

        Fix #167259, reported by  Christian Persch:
	
	* gtk/gtkwidget.c (gtk_widget_unparent): Unmap the reparented 
	widget, even if we avoid the unrealizing. 
	(gtk_widget_reparent_subwindows): Make reparenting work for
	!NO_WINDOW widgets which have other windows which are siblings
	of widget->window (as e.g. GtkSpinButton).