GNOME Bugzilla – Bug 687816
GtkTreeView does not draw correctly since commit aaedc7b6
Last modified: 2012-11-26 02:00:05 UTC
Created attachment 228322 [details] [review] Recalculate row height when adding columns Forwarded from https://bugs.archlinux.org/task/32343. In Audacious, we create a GtkTreeView like so: gtk_tree_view_new_with_model() gtk_tree_view_set_fixed_height_mode(TRUE) gtk_tree_view_append_column() gtk_tree_view_append_column() ... gtk_tree_view_set_fixed_height_mode() calls validate_row() on one row of the model in order to calculate the row height for all rows. The problem is, the row height cannot be calculated correctly before columns are added to the view, leading to visual corruption as illustrated in this screencast: https://bugs.archlinux.org/task/32343?getfile=9556 Before commit aaedc7b6, this was not a problem because gtk_tree_view_style_updated() was called when the treeview was realized (after the columns had been added), causing the row height to be recalculated. Commit aaedc7b6 causes the gtk_tree_view_style_updated() call to be optimized out, and as an unintended consequence, the treeview is now drawn with the incorrect row height calculated by gtk_tree_view_set_fixed_height_mode() before any columns were added. I am attaching a patch that copies into gtk_tree_view_insert_column() the same two lines used in gtk_tree_view_style_updated() to make sure that the row height gets recalculated. There may be a more optimal fix, but this at least gets the job done.
Should be fixed (with testcase) in master and GTK 3.6.
Fixed for me, thanks!