GNOME Bugzilla – Bug 633670
Child minimum/natural size is not respected by GtkScrolledWindow
Last modified: 2010-11-08 23:40:00 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!
Created attachment 173612 [details] [review] gtkscrolledwindow: respect child's size request. Bug #633670
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