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 767238 - Fix long standing regression in min-content-width/min-content-height
Fix long standing regression in min-content-width/min-content-height
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-06-04 13:04 UTC by Tristan Van Berkom
Modified: 2016-06-06 03:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Glade file demonstrating broken minimum content sizes (6.02 KB, application/x-glade)
2016-06-04 13:04 UTC, Tristan Van Berkom
  Details
Include scrollbar widths in addition to minimum content sizes (1.65 KB, patch)
2016-06-04 13:10 UTC, Tristan Van Berkom
accepted-commit_now Details | Review

Description Tristan Van Berkom 2016-06-04 13:04:47 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.
Comment 1 Tristan Van Berkom 2016-06-04 13:10:24 UTC
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.
Comment 2 Matthias Clasen 2016-06-05 13:24:50 UTC
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.
Comment 3 Tristan Van Berkom 2016-06-06 03:03:54 UTC
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.
Comment 4 Tristan Van Berkom 2016-06-06 03:06:12 UTC
Oops, mid-air commit collision - above mentioned change is actually commit 03742e8.