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 741130 - Entry completion with multiple cells can size wrong on first appearance
Entry completion with multiple cells can size wrong on first appearance
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-12-04 20:49 UTC by Matt Watson
Modified: 2014-12-10 21:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gjs minimal example (769 bytes, application/javascript)
2014-12-04 20:49 UTC, Matt Watson
  Details
patch fix (2.00 KB, patch)
2014-12-04 21:07 UTC, Matt Watson
none Details | Review
patch fix (2.16 KB, patch)
2014-12-05 02:20 UTC, Matt Watson
committed Details | Review

Description Matt Watson 2014-12-04 20:49:35 UTC
Created attachment 292150 [details]
gjs minimal example

Noticed this in yelp. Sometimes the search completion will show up too small, and I think its because yelp adds some custom cells into its treeview.

You can easily reproduce in yelp by typing "pri" in the search to match printing help pages. The entry completion will show up very small with a scrollbar. Typing another character will cause it to pop to the correct size.

Attaching a minimal example gjs script. Open it up and type "a" and the completion will show up too small. Delete "a" and type "b" and the completion will show up properly.
Comment 1 Matt Watson 2014-12-04 21:07:22 UTC
Entry completion is the one place in all of gtk that gtk_tree_view_column_cell_get_size is called outside of the tree view itself.
https://git.gnome.org/browse/gtk+/tree/gtk/gtkentrycompletion.c#n1528

It calls into the column size function before the tree view has validated its cell state. In particulate validate_rows in gtktreeview.c will trigger gtk_cell_area_apply_attributes on the cell areas.

Attaching a patch that calls gtk_widget_get_preferred_size on the tree view before calling gtk_tree_view_column_cell_get_size, ensuring the tree view runs validate_rows first. Seemed like the simplest fix without a larger rewrite of entry completion's sizing code. But there's also quite a lot of code to track here between all tree view, columns and cells, so I might be missing a better fix.
Comment 2 Matt Watson 2014-12-04 21:07:57 UTC
Created attachment 292152 [details] [review]
patch fix
Comment 3 Matt Watson 2014-12-05 02:20:32 UTC
Created attachment 292164 [details] [review]
patch fix
Comment 4 Matthias Clasen 2014-12-10 19:24:29 UTC
Review of attachment 292164 [details] [review]:

looks ok as a hacky workaround. Just please strip the internal bug ref from the commit message. Or replace it with a publicly accessible url
Comment 5 Cosimo Cecchi 2014-12-10 21:35:03 UTC
Pushed to master.