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 633670 - Child minimum/natural size is not respected by GtkScrolledWindow
Child minimum/natural size is not respected by GtkScrolledWindow
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
2.91.x
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
EL
Depends on:
Blocks:
 
 
Reported: 2010-11-01 02:55 UTC by Diego Escalante Urrelo (not reading bugmail)
Modified: 2010-11-08 23:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkscrolledwindow: respect child's size request. (1.22 KB, patch)
2010-11-01 02:56 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review

Description Diego Escalante Urrelo (not reading bugmail) 2010-11-01 02:55:17 UTC
You can test this with tests/testentrycompletion, type "to" in the first GtkEntry and you'll get a completion that is force to be two rows tall (somewhat around 60 px).

The completion should try to use all the screen height it can, according to our beloved formula in _gtk_entry_completion_resize_popup(). Logically, in this function a gtk_widget_set_size_request is called to force the minimum size of the GtkTreeView to be useful. GtkScrolledWindow is not respecting this though.

In gtk_scrolled_window_get_preferred_size () the min_child_size / nat_child_size values are never used. Inline snip of the attached patch:
          else
            {
              gint min_content_height = priv->min_content_height;
 
              if (min_content_height >= 0)
                {
-                 minimum_req.height = MAX (minimum_req.height, min_content_height);
-                 natural_req.height = MAX (natural_req.height, min_content_height);
+                 minimum_req.height = MAX (min_child_size, min_content_height);
+                 natural_req.height = MAX (nat_child_size, min_content_height);
                  extra_height = -1;

GTK_ORIENTATION_HORIZONTAL has a similar -possible- bug, I didn't try triggering a similar bug through that path.

I doubt this fix is 100% correct, but I better file a bug before I forget!
Comment 1 Diego Escalante Urrelo (not reading bugmail) 2010-11-01 02:56:04 UTC
Created attachment 173612 [details] [review]
gtkscrolledwindow: respect child's size request.

Bug #633670
Comment 2 Matthias Clasen 2010-11-08 23:40:00 UTC
commit 1ddf183bac5499eebbaed0c977acd4731a08da67
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Mon Nov 8 18:37:37 2010 -0500

    Fix entry completion window sizing
    
    I don't think we are at the end of scrolledwindow tweaks yet,
    but this will make things work for now, as they used to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633670