GNOME Bugzilla – Bug 690099
GtkScrolledWindow with NEVER policy don't resize with children
Last modified: 2012-12-12 14:03:52 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.
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.
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.
Attachment 231371 [details] pushed as 0cb714f - Use GTK_RESIZE_PARENT resize_mode for GtkViewport