GNOME Bugzilla – Bug 776937
GtkExpander is incorrectly hiding content.
Last modified: 2017-08-24 20:44:06 UTC
When hiding the content it is hidden, but you are still able to edit the content. Make an expander with an Entry and unexpand the Expander. You are still able to edit the Entry. Se Expander demo in gtk3-demo. Try to unexpand the text box (The box is not editable), but you can see the cursor is changed to a text cursor, when hovering just below the expander. Gtk+ 3.20.9 on Fedora 24
This also happens on Gtk+ 3.22.6 on Fedora 25
We have the same problem with GTK 3.22.12 on Fedora 26. When the expander is collapsed, its content is invisible, but still clickable and the cursor reacts to its presence. As a workaround, we manually set the visibility of the content in a callback that is connected to the activate signal.
also confirmed with 3.22.16 on Windows, of all places see also bug 774134, which although opened for a seemingly different issue, around the middle became a discussion of this one *** This bug has been marked as a duplicate of bug 774134 ***
sorry, got my bugs/statuses mixed up
Created attachment 358316 [details] [review] Expander: Actually hide child when collapsing Just adding/removing it to/from the gadget is not sufficient; that leaves the GdkWindow hanging around, taking input, changing the cursor, and all sorts of other nefarious shenanigans. -- This seems to be the simplest solution, and to work here. Please apply and test with your own cases, and let me know whether it (A) fixes the reported problems and (B) doesn't somehow break anything else.
(In reply to Vendula Poncova from comment #2) > As a workaround, we manually set the visibility of the content in a callback > that is connected to the activate signal. I used notify::expanded, which worked around it, but the above should work too.
*** Bug 776322 has been marked as a duplicate of this bug. ***
Review of attachment 358316 [details] [review]: ::: gtk/gtkexpander.c @@ +1268,3 @@ if (child) { + gtk_widget_set_visible (child, priv->expanded); This will queue_resize() on the parent expander in gtk_widget_hide(), so it should replace the call to queue_resize(expander) a few lines down.
Created attachment 358323 [details] [review] Expander: Actually hide child when collapsing
Created attachment 358376 [details] [review] Expander: Actually hide child when collapsing Just adding/removing to/from the BoxGadget is not sufficient; that leaves the GdkWindow hanging around, taking input, changing the cursor, and all sorts of other nefarious shenanigans. Resolve by ensuring the child’s GdkWindow is unmapped if collapsed. Note: the reflexive solution is just to set_visible(child, expanded), but it is best to avoid messing with the child’s :visible property. -- This adds handling for add()ing a child to a currently collapsed expander. Matthias and Timm acked this one on IRC.
This should be fixed now, but please reopen if any gremlins remain. Thanks for the reports!