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 700185 - GtkWindow: problem with child widget visibility
GtkWindow: problem with child widget visibility
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-05-12 16:03 UTC by Sébastien Wilmet
Modified: 2013-05-31 10:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple test program to reproduce the bug (802 bytes, text/plain)
2013-05-12 16:03 UTC, Sébastien Wilmet
Details
python example (583 bytes, text/x-python)
2013-05-26 19:34 UTC, Christoph Reiter (lazka)
Details
python example (584 bytes, text/x-python)
2013-05-26 19:36 UTC, Christoph Reiter (lazka)
Details

Description Sébastien Wilmet 2013-05-12 16:03:54 UTC
Created attachment 243925 [details]
Simple test program to reproduce the bug

Take a GtkWindow with a visible child widget.
Show the window: the child widget is visible, alright.
Hide the window and re-show it: the child widget is now hidden instead of being visible.

This regression has been introduced during the 3.6 -> 3.8 cycle I think, and still exists in gtk+ master.
Comment 1 Matthias Clasen 2013-05-13 09:39:54 UTC
works correctly here, with both 3.8 and master.
Comment 2 Christoph Reiter (lazka) 2013-05-26 19:34:27 UTC
Created attachment 245355 [details]
python example

Another example using pygobject:

- execute script
- click button
- popup window shows with label
- click again
- popup window hides
- click again
EXPECTED:
- window shows again with label
ACTUAL RESULT:
- window shows but is empty

NOTE: this seems to work in Gnome Shell, but not with metacity or in xfce
Tested with debian sid and arch linux
Comment 3 Christoph Reiter (lazka) 2013-05-26 19:36:44 UTC
Created attachment 245356 [details]
python example

typo...

Also I forgot:

Calling widget.unrealize() after widget.hide() seems to fix it.
Comment 4 Sébastien Wilmet 2013-05-26 19:49:32 UTC
Indeed, I use Xfce and the bug still occurs with an updated gtk+ master.

Xfce 4.8 on Debian testing.

With GTK+ 3.4 from Debian, the bug doesn't occur.
Comment 5 Christoph Reiter (lazka) 2013-05-30 17:15:24 UTC
97ba4b1b8eb82563f13762a4bd8cfe9beb8a121c is the first bad commit
commit 97ba4b1b8eb82563f13762a4bd8cfe9beb8a121c
Author: Benjamin Otte <otte@redhat.com>
Date:   Mon Jan 14 17:59:31 2013 +0100

    window: Don't use set_allocation() to store cached values
    
    The window size can be queried on widget->window directly, no need to
    store it in widget->allocation.
    This change is necessary because gtk_widget_set_allcation() is now
    checking invariants that assume it's called from insize
    gtk_widget_size_allocate() and that wasn;t the case here.
Comment 6 Benjamin Otte (Company) 2013-05-30 17:29:44 UTC
t 4e50596b37eb6747656c24fc53ed42c88e798cf5
Author: Benjamin Otte <otte@redhat.com>
Date:   Thu May 30 19:28:08 2013 +0200

    window: Call size_allocate() to allocate a size

    Don't call gtk_container_resize_children().
Comment 7 Sébastien Wilmet 2013-05-31 10:19:32 UTC
I confirm that the bug is fixed on Xfce (both the gtk-3-8 and master branches).
Thanks!