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 690099 - GtkScrolledWindow with NEVER policy don't resize with children
GtkScrolledWindow with NEVER policy don't resize with children
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-12-12 13:44 UTC by Alexander Larsson
Modified: 2012-12-12 14:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make GtkScrolledWindow resize properly with children (6.58 KB, patch)
2012-12-12 13:45 UTC, Alexander Larsson
none Details | Review
Use GTK_RESIZE_PARENT resize_mode for GtkViewport (1.39 KB, patch)
2012-12-12 14:03 UTC, Alexander Larsson
committed Details | Review

Description Alexander Larsson 2012-12-12 13:44:26 UTC
We recently had an issue with gnome-control-center where it used scrolled windows with NEVER/NEVER policies, but those never resized when the content
changed. At least not until something else like a :backdrop change caused a resize of the ScrolledWindow.

The reason for this is that GtkViewport has a QUEUE resize_mode, so it swallows
any size changes in the children of the scrolled window.
Comment 1 Alexander Larsson 2012-12-12 13:45:01 UTC
Created attachment 231366 [details] [review]
Make GtkScrolledWindow resize properly with children

GtkViewport is currently always using resize_mode QUEUE, i.e. if the viewport
or a child is resized the parent is not told. In the case of a scrolled
window parent this is a problem if a scrolling policy of NEVER has
been set in any direction, because that means the size of the scrolled
window should depend on the child, but we don't get told of such changes.

We solve this by adding gtk_scrollable_set_sizes_freely() which tells
the overview wheter it can use QUEUE resize_mode or not.
Comment 2 Alexander Larsson 2012-12-12 14:03:02 UTC
Created attachment 231371 [details] [review]
Use GTK_RESIZE_PARENT resize_mode for GtkViewport

We used to use GTK_RESIZE_QUEUE, but that is problematic for e.g
a GtkScrolledWindow with NEVER scroll policies, as size changes
in ancestors will never get propagated to the scrolled window, causing
it to not have the correct size.

This is a slight performance hit, but in practice its not bound to be
problematic. In typical UIs there is only a single "large" GtkScrolledWindow
visible at a time, so a size requeust propagating out of such a window
will only hit the smaller amount of widgetry outside the scrolled window,
and additionally all such widgets will have their size request caches
still valid.
Comment 3 Alexander Larsson 2012-12-12 14:03:49 UTC
Attachment 231371 [details] pushed as 0cb714f - Use GTK_RESIZE_PARENT resize_mode for GtkViewport