GNOME Bugzilla – Bug 767238
Fix long standing regression in min-content-width/min-content-height
Last modified: 2016-06-06 03:06:12 UTC
Created attachment 329117 [details] Glade file demonstrating broken minimum content sizes I suspect this regressed a long time ago when moving minimum content sizes from the GtkScrollable iface to GtkScrolledWindow, as of commit 0d9ebb501. Explanation: The reason why we have a minimum content size in the first place, is to allow one to declare the minimum amount of _visible_ area in the scrolled window content, which is to say, regardless of how the scrolled window is configured and whether scrollbars appear, we ensure the content is at least that minimum size. The current behavior of min-content-size instead has the same effect as setting a width-request on the scrolled window with gtk_widget_set_size_request(). The attached glade file demonstrates the issue as such: GtkWindow GtkScrolledWindow (min-content-width = 300, overlay-scrollbar = FALSE) GtkViewport GtkBox GtkLabel (width-request = 300, long ellipsis label) GtkLabel (width-request = 300, long ellipsis label) GtkLabel (width-request = 300, long ellipsis label) GtkLabel (width-request = 300, long ellipsis label) GtkLabel (width-request = 300, long ellipsis label) GtkLabel (width-request = 300, long ellipsis label) When displaying this glade file, we can observe that when the window is at it's minimum size, the vertical scrollbar overlaps the GtkLabels and we do not see the ellipsis at the end as they are hidden below the scrollbar.
Created attachment 329118 [details] [review] Include scrollbar widths in addition to minimum content sizes This patch fixes the issue. The minimum content sizes, must be requested in *addition* to the scrollbar widths/heights (if scrollbars appear), not instead of them.
Review of attachment 329118 [details] [review]: Looks fine to me. The documentation of the min-content size properties is not specific enough to say either way, but I think this makes sense. And it doesn't cause any other problems, as far as I can see.
The above change was introduced in b4ebe4e probably mixed in with the gestures cleanup in finalize patch by accident. Additionally pushed commit c828696 today which pushes the scrollbar size clause to after the min/max content size clamping introduced in commit 4e5ecb7 (for bug 742281) - So content size properties only effect the size of the content and not any additional space required by the surrounding scrolled window.
Oops, mid-air commit collision - above mentioned change is actually commit 03742e8.