Merge lp:~bellini666/gtk/fix_1427352 into lp:~ubuntu-desktop/gtk/ubuntugtk3trusty
- fix_1427352
- Merge into ubuntugtk3trusty
Proposed by
Thiago Bellini
Status: | Merged |
---|---|
Merged at revision: | 344 |
Proposed branch: | lp:~bellini666/gtk/fix_1427352 |
Merge into: | lp:~ubuntu-desktop/gtk/ubuntugtk3trusty |
Diff against target: |
523 lines (+498/-0) 4 files modified
debian/changelog (+9/-0) debian/patches/revert-better-resize-of-expandable-columns.patch (+123/-0) debian/patches/revert-use-minumum-natural-size-semantics.patch (+364/-0) debian/patches/series (+2/-0) |
To merge this branch: | bzr merge lp:~bellini666/gtk/fix_1427352 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Desktop | Pending | ||
Review via email: mp+251508@code.launchpad.net |
Commit message
Description of the change
Fix for LP:#1427352
Upstream bug: https:/
To post a comment you must log in.
Revision history for this message
Thiago Bellini (bellini666) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2015-01-15 15:01:30 +0000 | |||
3 | +++ debian/changelog 2015-03-02 19:52:16 +0000 | |||
4 | @@ -1,3 +1,12 @@ | |||
5 | 1 | gtk+3.0 (3.10.8-0ubuntu1.5) trusty; urgency=low | ||
6 | 2 | |||
7 | 3 | * debian/patches/revert-better-resize-of-expandable-columns.patch | ||
8 | 4 | debian/patches/revert-use-minumum-natural-size-semantics.patch | ||
9 | 5 | - Port of an upstream bug: | ||
10 | 6 | https://bugzilla.gnome.org/show_bug.cgi?id=731054 (LP: #1427352) | ||
11 | 7 | |||
12 | 8 | -- Thiago Bellini Ribeiro <hackedbellini@gmail.com> Mon, 02 Mar 2015 16:26:25 -0300 | ||
13 | 9 | |||
14 | 1 | gtk+3.0 (3.10.8-0ubuntu1.4) trusty-security; urgency=medium | 10 | gtk+3.0 (3.10.8-0ubuntu1.4) trusty-security; urgency=medium |
15 | 2 | 11 | ||
16 | 3 | * debian/patches/no_popup_menu_in_gtk_window.patch | 12 | * debian/patches/no_popup_menu_in_gtk_window.patch |
17 | 4 | 13 | ||
18 | === added file 'debian/patches/revert-better-resize-of-expandable-columns.patch' | |||
19 | --- debian/patches/revert-better-resize-of-expandable-columns.patch 1970-01-01 00:00:00 +0000 | |||
20 | +++ debian/patches/revert-better-resize-of-expandable-columns.patch 2015-03-02 19:52:16 +0000 | |||
21 | @@ -0,0 +1,123 @@ | |||
22 | 1 | From 73ff6a8e0ff307b8d14986c64918022364ff10e7 Mon Sep 17 00:00:00 2001 | ||
23 | 2 | From: Matthias Clasen <mclasen@redhat.com> | ||
24 | 3 | Date: Sun, 1 Jun 2014 10:15:41 -0400 | ||
25 | 4 | Subject: Revert "Better resize of expandable columns" | ||
26 | 5 | |||
27 | 6 | This reverts commit 0050d469b592ec571a5940f1ab1d842a76905e17. | ||
28 | 7 | |||
29 | 8 | Conflicts: | ||
30 | 9 | gtk/gtktreeview.c | ||
31 | 10 | |||
32 | 11 | --- a/gtk/gtktreeview.c | ||
33 | 12 | +++ b/gtk/gtktreeview.c | ||
34 | 13 | @@ -2544,71 +2544,6 @@ gtk_tree_view_get_preferred_height (GtkW | ||
35 | 14 | *natural = height; | ||
36 | 15 | } | ||
37 | 16 | |||
38 | 17 | -static void | ||
39 | 18 | -gtk_tree_view_modify_column_width (GtkTreeView *tree_view, | ||
40 | 19 | - GtkTreeViewColumn *column, | ||
41 | 20 | - gint width) | ||
42 | 21 | -{ | ||
43 | 22 | - gboolean is_expand; | ||
44 | 23 | - gint n_expand_others; | ||
45 | 24 | - gint minimum, natural, natural_others; | ||
46 | 25 | - gint expand; | ||
47 | 26 | - | ||
48 | 27 | - is_expand = gtk_tree_view_column_get_expand (column); | ||
49 | 28 | - n_expand_others = tree_view->priv->n_expand_columns - (is_expand ? 1 : 0); | ||
50 | 29 | - | ||
51 | 30 | - _gtk_tree_view_column_request_width (column, &minimum, &natural); | ||
52 | 31 | - natural_others = tree_view->priv->natural_width - natural; | ||
53 | 32 | - | ||
54 | 33 | - if (natural_others + width < tree_view->priv->width) | ||
55 | 34 | - { | ||
56 | 35 | - /* There is extra space that needs to be taken up by letting some other | ||
57 | 36 | - * column(s) expand: by default, the last column. */ | ||
58 | 37 | - if (!n_expand_others) | ||
59 | 38 | - { | ||
60 | 39 | - GList *last = g_list_last (tree_view->priv->columns); | ||
61 | 40 | - while (!gtk_tree_view_column_get_visible (last->data)) | ||
62 | 41 | - last = last->prev; | ||
63 | 42 | - | ||
64 | 43 | - if (column == last->data) | ||
65 | 44 | - return; | ||
66 | 45 | - | ||
67 | 46 | - gtk_tree_view_column_set_expand (last->data, TRUE); | ||
68 | 47 | - n_expand_others++; | ||
69 | 48 | - } | ||
70 | 49 | - | ||
71 | 50 | - /* Now try to make this column expandable also. Solving the following | ||
72 | 51 | - * equations reveals what the natural width should be to achieve the | ||
73 | 52 | - * desired width after expanding: | ||
74 | 53 | - * | ||
75 | 54 | - * 1. natural + expand = desired_width | ||
76 | 55 | - * 2. natural + natural_others + expand * (n_expand_others + 1) = total_width | ||
77 | 56 | - * | ||
78 | 57 | - * Solution: | ||
79 | 58 | - * expand = (total_width - natural_others - desired_width) / n_expand_others | ||
80 | 59 | - * | ||
81 | 60 | - * It is possible for the solved natural width to be less than the | ||
82 | 61 | - * minimum; in that case, we cannot let the column expand. | ||
83 | 62 | - */ | ||
84 | 63 | - expand = (tree_view->priv->width - natural_others - width) / n_expand_others; | ||
85 | 64 | - | ||
86 | 65 | - if (minimum + expand > width) | ||
87 | 66 | - { | ||
88 | 67 | - if (is_expand) | ||
89 | 68 | - gtk_tree_view_column_set_expand (column, FALSE); | ||
90 | 69 | - } | ||
91 | 70 | - else | ||
92 | 71 | - { | ||
93 | 72 | - if (!is_expand) | ||
94 | 73 | - gtk_tree_view_column_set_expand (column, TRUE); | ||
95 | 74 | - | ||
96 | 75 | - width -= expand; | ||
97 | 76 | - } | ||
98 | 77 | - } | ||
99 | 78 | - | ||
100 | 79 | - gtk_tree_view_column_set_fixed_width (column, width); | ||
101 | 80 | -} | ||
102 | 81 | - | ||
103 | 82 | static int | ||
104 | 83 | gtk_tree_view_calculate_width_before_expander (GtkTreeView *tree_view) | ||
105 | 84 | { | ||
106 | 85 | @@ -3386,6 +3321,9 @@ gtk_tree_view_button_press (GtkWidget | ||
107 | 86 | drag_data); | ||
108 | 87 | |||
109 | 88 | column_width = gtk_tree_view_column_get_width (column); | ||
110 | 89 | + gtk_tree_view_column_set_fixed_width (column, column_width); | ||
111 | 90 | + gtk_tree_view_column_set_expand (column, FALSE); | ||
112 | 91 | + | ||
113 | 92 | gdk_window_get_device_position (tree_view->priv->bin_window, | ||
114 | 93 | gdk_event_get_device ((GdkEvent *) event), | ||
115 | 94 | &x, NULL, NULL); | ||
116 | 95 | @@ -4137,14 +4075,14 @@ gtk_tree_view_motion_resize_column (GtkW | ||
117 | 96 | gdk_window_get_device_position (tree_view->priv->bin_window, | ||
118 | 97 | gdk_event_get_device ((GdkEvent *) event), | ||
119 | 98 | &x, NULL, NULL); | ||
120 | 99 | - | ||
121 | 100 | + | ||
122 | 101 | if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
123 | 102 | new_width = MAX (tree_view->priv->x_drag - x, 0); | ||
124 | 103 | else | ||
125 | 104 | new_width = MAX (x - tree_view->priv->x_drag, 0); | ||
126 | 105 | - | ||
127 | 106 | - if (new_width != gtk_tree_view_column_get_width (column)) | ||
128 | 107 | - gtk_tree_view_modify_column_width (tree_view, column, new_width); | ||
129 | 108 | + | ||
130 | 109 | + if (new_width != gtk_tree_view_column_get_fixed_width (column)) | ||
131 | 110 | + gtk_tree_view_column_set_fixed_width (column, new_width); | ||
132 | 111 | |||
133 | 112 | return FALSE; | ||
134 | 113 | } | ||
135 | 114 | @@ -5869,7 +5807,8 @@ gtk_tree_view_key_press (GtkWidget *wi | ||
136 | 115 | column_width = column_width + 2; | ||
137 | 116 | } | ||
138 | 117 | |||
139 | 118 | - gtk_tree_view_modify_column_width (tree_view, column, column_width); | ||
140 | 119 | + gtk_tree_view_column_set_fixed_width (column, column_width); | ||
141 | 120 | + gtk_tree_view_column_set_expand (column, FALSE); | ||
142 | 121 | return TRUE; | ||
143 | 122 | } | ||
144 | 123 | |||
145 | 0 | 124 | ||
146 | === added file 'debian/patches/revert-use-minumum-natural-size-semantics.patch' | |||
147 | --- debian/patches/revert-use-minumum-natural-size-semantics.patch 1970-01-01 00:00:00 +0000 | |||
148 | +++ debian/patches/revert-use-minumum-natural-size-semantics.patch 2015-03-02 19:52:16 +0000 | |||
149 | @@ -0,0 +1,364 @@ | |||
150 | 1 | From a3cd0ee7d8a610feff39984254306cec4a6c9c73 Mon Sep 17 00:00:00 2001 | ||
151 | 2 | From: Matthias Clasen <mclasen@redhat.com> | ||
152 | 3 | Date: Sun, 1 Jun 2014 10:16:01 -0400 | ||
153 | 4 | Subject: Revert "Use minimum/natural size semantics" | ||
154 | 5 | |||
155 | 6 | This reverts commit 6d53c2339f79baa0b295ecc614f41f9daab2e132. | ||
156 | 7 | |||
157 | 8 | https://bugzilla.gnome.org/show_bug.cgi?id=731054 showed some | ||
158 | 9 | major regressions caused by this commit. | ||
159 | 10 | |||
160 | 11 | --- a/gtk/gtktreeprivate.h | ||
161 | 12 | +++ b/gtk/gtktreeprivate.h | ||
162 | 13 | @@ -100,9 +100,7 @@ void _gtk_tree_view_column_unrealize_but | ||
163 | 14 | |||
164 | 15 | void _gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column, | ||
165 | 16 | GtkTreeView *tree_view); | ||
166 | 17 | -void _gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column, | ||
167 | 18 | - gint *minimum, | ||
168 | 19 | - gint *natural); | ||
169 | 20 | +gint _gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column); | ||
170 | 21 | void _gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column, | ||
171 | 22 | int x_offset, | ||
172 | 23 | int width); | ||
173 | 24 | --- a/gtk/gtktreeview.c | ||
174 | 25 | +++ b/gtk/gtktreeview.c | ||
175 | 26 | @@ -386,10 +386,10 @@ struct _GtkTreeViewPrivate | ||
176 | 27 | gint drag_pos; | ||
177 | 28 | gint x_drag; | ||
178 | 29 | |||
179 | 30 | - /* Column width allocation */ | ||
180 | 31 | - gint minimum_width; | ||
181 | 32 | - gint natural_width; | ||
182 | 33 | - gint n_expand_columns; | ||
183 | 34 | + /* Non-interactive Header Resizing, expand flag support */ | ||
184 | 35 | + gint last_extra_space; | ||
185 | 36 | + gint last_extra_space_per_column; | ||
186 | 37 | + gint last_number_of_expand_columns; | ||
187 | 38 | |||
188 | 39 | /* ATK Hack */ | ||
189 | 40 | GtkTreeDestroyCountFunc destroy_count_func; | ||
190 | 41 | @@ -494,6 +494,8 @@ struct _GtkTreeViewPrivate | ||
191 | 42 | |||
192 | 43 | guint in_scroll : 1; | ||
193 | 44 | |||
194 | 45 | + guint post_validation_flag : 1; | ||
195 | 46 | + | ||
196 | 47 | /* Whether our key press handler is to avoid sending an unhandled binding to the search entry */ | ||
197 | 48 | guint search_entry_avoid_unhandled_binding : 1; | ||
198 | 49 | |||
199 | 50 | @@ -1749,9 +1751,6 @@ gtk_tree_view_init (GtkTreeView *tree_vi | ||
200 | 51 | tree_view->priv->header_height = 1; | ||
201 | 52 | tree_view->priv->x_drag = 0; | ||
202 | 53 | tree_view->priv->drag_pos = -1; | ||
203 | 54 | - tree_view->priv->minimum_width = 0; | ||
204 | 55 | - tree_view->priv->natural_width = 0; | ||
205 | 56 | - tree_view->priv->n_expand_columns = 0; | ||
206 | 57 | tree_view->priv->header_has_focus = FALSE; | ||
207 | 58 | tree_view->priv->pressed_button = -1; | ||
208 | 59 | tree_view->priv->press_start_x = -1; | ||
209 | 60 | @@ -1785,6 +1784,8 @@ gtk_tree_view_init (GtkTreeView *tree_vi | ||
210 | 61 | |||
211 | 62 | tree_view->priv->tooltip_column = -1; | ||
212 | 63 | |||
213 | 64 | + tree_view->priv->post_validation_flag = FALSE; | ||
214 | 65 | + | ||
215 | 66 | tree_view->priv->last_button_x = -1; | ||
216 | 67 | tree_view->priv->last_button_y = -1; | ||
217 | 68 | |||
218 | 69 | @@ -2502,16 +2503,12 @@ gtk_tree_view_get_preferred_width (GtkWi | ||
219 | 70 | GtkTreeView *tree_view = GTK_TREE_VIEW (widget); | ||
220 | 71 | GList *list; | ||
221 | 72 | GtkTreeViewColumn *column; | ||
222 | 73 | - gint column_minimum, column_natural; | ||
223 | 74 | + gint width = 0; | ||
224 | 75 | |||
225 | 76 | /* we validate some rows initially just to make sure we have some size. | ||
226 | 77 | * In practice, with a lot of static lists, this should get a good width. | ||
227 | 78 | */ | ||
228 | 79 | do_validate_rows (tree_view, FALSE); | ||
229 | 80 | - | ||
230 | 81 | - tree_view->priv->minimum_width = 0; | ||
231 | 82 | - tree_view->priv->natural_width = 0; | ||
232 | 83 | - tree_view->priv->n_expand_columns = 0; | ||
233 | 84 | |||
234 | 85 | /* keep this in sync with size_allocate below */ | ||
235 | 86 | for (list = tree_view->priv->columns; list; list = list->next) | ||
236 | 87 | @@ -2520,18 +2517,13 @@ gtk_tree_view_get_preferred_width (GtkWi | ||
237 | 88 | if (!gtk_tree_view_column_get_visible (column) || column == tree_view->priv->drag_column) | ||
238 | 89 | continue; | ||
239 | 90 | |||
240 | 91 | - _gtk_tree_view_column_request_width (column, &column_minimum, &column_natural); | ||
241 | 92 | - tree_view->priv->minimum_width += column_minimum; | ||
242 | 93 | - tree_view->priv->natural_width += column_natural; | ||
243 | 94 | - | ||
244 | 95 | - if (gtk_tree_view_column_get_expand (column)) | ||
245 | 96 | - tree_view->priv->n_expand_columns++; | ||
246 | 97 | + width += _gtk_tree_view_column_request_width (column); | ||
247 | 98 | } | ||
248 | 99 | |||
249 | 100 | if (minimum != NULL) | ||
250 | 101 | - *minimum = tree_view->priv->minimum_width; | ||
251 | 102 | + *minimum = width; | ||
252 | 103 | if (natural != NULL) | ||
253 | 104 | - *natural = tree_view->priv->natural_width; | ||
254 | 105 | + *natural = width; | ||
255 | 106 | } | ||
256 | 107 | |||
257 | 108 | static void | ||
258 | 109 | @@ -2646,9 +2638,12 @@ gtk_tree_view_size_allocate_columns (Gtk | ||
259 | 110 | GList *list, *first_column, *last_column; | ||
260 | 111 | GtkTreeViewColumn *column; | ||
261 | 112 | GtkAllocation widget_allocation; | ||
262 | 113 | - gint minimum_width, natural_width, n_expand_columns, width; | ||
263 | 114 | - gint column_minimum, column_natural, column_width; | ||
264 | 115 | + gint width = 0; | ||
265 | 116 | + gint extra, extra_per_column, extra_for_last; | ||
266 | 117 | + gint full_requested_width = 0; | ||
267 | 118 | + gint number_of_expand_columns = 0; | ||
268 | 119 | gboolean rtl; | ||
269 | 120 | + gboolean update_expand; | ||
270 | 121 | |||
271 | 122 | tree_view = GTK_TREE_VIEW (widget); | ||
272 | 123 | |||
273 | 124 | @@ -2668,65 +2663,111 @@ gtk_tree_view_size_allocate_columns (Gtk | ||
274 | 125 | |||
275 | 126 | rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); | ||
276 | 127 | |||
277 | 128 | - gtk_widget_get_allocation (widget, &widget_allocation); | ||
278 | 129 | + /* find out how many extra space and expandable columns we have */ | ||
279 | 130 | + for (list = tree_view->priv->columns; list != last_column->next; list = list->next) | ||
280 | 131 | + { | ||
281 | 132 | + column = (GtkTreeViewColumn *)list->data; | ||
282 | 133 | |||
283 | 134 | - minimum_width = tree_view->priv->minimum_width; | ||
284 | 135 | - natural_width = tree_view->priv->natural_width; | ||
285 | 136 | - n_expand_columns = tree_view->priv->n_expand_columns; | ||
286 | 137 | + if (!gtk_tree_view_column_get_visible (column) || column == tree_view->priv->drag_column) | ||
287 | 138 | + continue; | ||
288 | 139 | |||
289 | 140 | - width = MAX (widget_allocation.width, minimum_width); | ||
290 | 141 | + full_requested_width += _gtk_tree_view_column_request_width (column); | ||
291 | 142 | |||
292 | 143 | - /* We change the width here. The user might have been resizing columns, | ||
293 | 144 | - * which changes the total width of the tree view. This is of | ||
294 | 145 | - * importance for getting the horizontal scroll bar right. | ||
295 | 146 | + if (gtk_tree_view_column_get_expand (column)) | ||
296 | 147 | + number_of_expand_columns++; | ||
297 | 148 | + } | ||
298 | 149 | + | ||
299 | 150 | + /* Only update the expand value if the width of the widget has changed, | ||
300 | 151 | + * or the number of expand columns has changed, or if there are no expand | ||
301 | 152 | + * columns, or if we didn't have an size-allocation yet after the | ||
302 | 153 | + * last validated node. | ||
303 | 154 | */ | ||
304 | 155 | - if (tree_view->priv->width != width) | ||
305 | 156 | + update_expand = (width_changed && *width_changed == TRUE) | ||
306 | 157 | + || number_of_expand_columns != tree_view->priv->last_number_of_expand_columns | ||
307 | 158 | + || number_of_expand_columns == 0 | ||
308 | 159 | + || tree_view->priv->post_validation_flag == TRUE; | ||
309 | 160 | + | ||
310 | 161 | + tree_view->priv->post_validation_flag = FALSE; | ||
311 | 162 | + | ||
312 | 163 | + gtk_widget_get_allocation (widget, &widget_allocation); | ||
313 | 164 | + if (!update_expand) | ||
314 | 165 | { | ||
315 | 166 | - tree_view->priv->width = width; | ||
316 | 167 | - if (width_changed) | ||
317 | 168 | - *width_changed = TRUE; | ||
318 | 169 | + extra = tree_view->priv->last_extra_space; | ||
319 | 170 | + extra_for_last = MAX (widget_allocation.width - full_requested_width - extra, 0); | ||
320 | 171 | } | ||
321 | 172 | + else | ||
322 | 173 | + { | ||
323 | 174 | + extra = MAX (widget_allocation.width - full_requested_width, 0); | ||
324 | 175 | + extra_for_last = 0; | ||
325 | 176 | + | ||
326 | 177 | + tree_view->priv->last_extra_space = extra; | ||
327 | 178 | + } | ||
328 | 179 | + | ||
329 | 180 | + if (number_of_expand_columns > 0) | ||
330 | 181 | + extra_per_column = extra/number_of_expand_columns; | ||
331 | 182 | + else | ||
332 | 183 | + extra_per_column = 0; | ||
333 | 184 | |||
334 | 185 | - /* iterate through columns in reverse order */ | ||
335 | 186 | - for (list = (rtl ? first_column : last_column); | ||
336 | 187 | - list != (rtl ? last_column->next : first_column->prev); | ||
337 | 188 | - list = (rtl ? list->next : list->prev)) | ||
338 | 189 | + if (update_expand) | ||
339 | 190 | { | ||
340 | 191 | + tree_view->priv->last_extra_space_per_column = extra_per_column; | ||
341 | 192 | + tree_view->priv->last_number_of_expand_columns = number_of_expand_columns; | ||
342 | 193 | + } | ||
343 | 194 | + | ||
344 | 195 | + for (list = (rtl ? last_column : first_column); | ||
345 | 196 | + list != (rtl ? first_column->prev : last_column->next); | ||
346 | 197 | + list = (rtl ? list->prev : list->next)) | ||
347 | 198 | + { | ||
348 | 199 | + gint column_width; | ||
349 | 200 | + | ||
350 | 201 | column = list->data; | ||
351 | 202 | |||
352 | 203 | if (!gtk_tree_view_column_get_visible (column) || column == tree_view->priv->drag_column) | ||
353 | 204 | continue; | ||
354 | 205 | |||
355 | 206 | - _gtk_tree_view_column_request_width (column, &column_minimum, &column_natural); | ||
356 | 207 | - | ||
357 | 208 | - column_width = column_natural; | ||
358 | 209 | + column_width = _gtk_tree_view_column_request_width (column); | ||
359 | 210 | |||
360 | 211 | - if (width > natural_width) | ||
361 | 212 | - { | ||
362 | 213 | - /* We need to expand some columns. If there are none marked to | ||
363 | 214 | - * expand, give all the extra space to the last column. */ | ||
364 | 215 | - if (n_expand_columns == 0) | ||
365 | 216 | + if (gtk_tree_view_column_get_expand (column)) | ||
366 | 217 | + { | ||
367 | 218 | + if (number_of_expand_columns == 1) | ||
368 | 219 | { | ||
369 | 220 | - column_width = column_natural + (width - natural_width); | ||
370 | 221 | + /* We add the remander to the last column as | ||
371 | 222 | + * */ | ||
372 | 223 | + column_width += extra; | ||
373 | 224 | } | ||
374 | 225 | - else if (gtk_tree_view_column_get_expand (column)) | ||
375 | 226 | + else | ||
376 | 227 | { | ||
377 | 228 | - column_width = column_natural + (width - natural_width) / n_expand_columns; | ||
378 | 229 | - n_expand_columns--; | ||
379 | 230 | + column_width += extra_per_column; | ||
380 | 231 | + extra -= extra_per_column; | ||
381 | 232 | + number_of_expand_columns --; | ||
382 | 233 | } | ||
383 | 234 | - } | ||
384 | 235 | - else if (width < natural_width) | ||
385 | 236 | + } | ||
386 | 237 | + else if (number_of_expand_columns == 0 && | ||
387 | 238 | + list == last_column) | ||
388 | 239 | { | ||
389 | 240 | - /* We need to shrink some columns. Starting with later columns, | ||
390 | 241 | - * shrink each one down to its minimum width as necessary. */ | ||
391 | 242 | - column_width = MAX (column_natural + (width - natural_width), column_minimum); | ||
392 | 243 | + column_width += extra; | ||
393 | 244 | } | ||
394 | 245 | - | ||
395 | 246 | - _gtk_tree_view_column_allocate (column, width - column_width, column_width); | ||
396 | 247 | - | ||
397 | 248 | - minimum_width -= column_minimum; | ||
398 | 249 | - natural_width -= column_natural; | ||
399 | 250 | - width -= column_width; | ||
400 | 251 | + | ||
401 | 252 | + /* In addition to expand, the last column can get even more | ||
402 | 253 | + * extra space so all available space is filled up. | ||
403 | 254 | + */ | ||
404 | 255 | + if (extra_for_last > 0 && list == last_column) | ||
405 | 256 | + column_width += extra_for_last; | ||
406 | 257 | + | ||
407 | 258 | + _gtk_tree_view_column_allocate (column, width, column_width); | ||
408 | 259 | + | ||
409 | 260 | + width += column_width; | ||
410 | 261 | + } | ||
411 | 262 | + | ||
412 | 263 | + /* We change the width here. The user might have been resizing columns, | ||
413 | 264 | + * which changes the total width of the tree view. This is of | ||
414 | 265 | + * importance for getting the horizontal scroll bar right. | ||
415 | 266 | + */ | ||
416 | 267 | + if (tree_view->priv->width != width) | ||
417 | 268 | + { | ||
418 | 269 | + tree_view->priv->width = width; | ||
419 | 270 | + if (width_changed) | ||
420 | 271 | + *width_changed = TRUE; | ||
421 | 272 | } | ||
422 | 273 | } | ||
423 | 274 | |||
424 | 275 | @@ -6241,6 +6282,7 @@ validate_row (GtkTreeView *tree_view, | ||
425 | 276 | _gtk_rbtree_node_set_height (tree, node, height); | ||
426 | 277 | } | ||
427 | 278 | _gtk_rbtree_node_mark_valid (tree, node); | ||
428 | 279 | + tree_view->priv->post_validation_flag = TRUE; | ||
429 | 280 | |||
430 | 281 | return retval; | ||
431 | 282 | } | ||
432 | 283 | --- a/gtk/gtktreeviewcolumn.c | ||
433 | 284 | +++ b/gtk/gtktreeviewcolumn.c | ||
434 | 285 | @@ -2087,48 +2087,48 @@ gtk_tree_view_column_get_x_offset (GtkTr | ||
435 | 286 | return tree_column->priv->x_offset; | ||
436 | 287 | } | ||
437 | 288 | |||
438 | 289 | -void | ||
439 | 290 | -_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column, | ||
440 | 291 | - gint *minimum, | ||
441 | 292 | - gint *natural) | ||
442 | 293 | +gint | ||
443 | 294 | +_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column) | ||
444 | 295 | { | ||
445 | 296 | - GtkTreeViewColumnPrivate *priv = tree_column->priv; | ||
446 | 297 | - gint minimum_width = 1, natural_width = 1; | ||
447 | 298 | - gint button_minimum, button_natural; | ||
448 | 299 | + GtkTreeViewColumnPrivate *priv; | ||
449 | 300 | + gint real_requested_width; | ||
450 | 301 | + | ||
451 | 302 | + priv = tree_column->priv; | ||
452 | 303 | |||
453 | 304 | - if (priv->column_type != GTK_TREE_VIEW_COLUMN_FIXED) | ||
454 | 305 | + if (priv->fixed_width != -1) | ||
455 | 306 | { | ||
456 | 307 | - gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &minimum_width, &natural_width); | ||
457 | 308 | - minimum_width += priv->padding; | ||
458 | 309 | - natural_width += priv->padding; | ||
459 | 310 | - | ||
460 | 311 | - if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view))) | ||
461 | 312 | - { | ||
462 | 313 | - gtk_widget_get_preferred_width (priv->button, &button_minimum, &button_natural); | ||
463 | 314 | - minimum_width = MAX (minimum_width, button_minimum); | ||
464 | 315 | - natural_width = MAX (natural_width, button_natural); | ||
465 | 316 | - } | ||
466 | 317 | + real_requested_width = priv->fixed_width; | ||
467 | 318 | } | ||
468 | 319 | + else if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view))) | ||
469 | 320 | + { | ||
470 | 321 | + gint button_request; | ||
471 | 322 | + gint requested_width; | ||
472 | 323 | |||
473 | 324 | - if (priv->fixed_width != -1) | ||
474 | 325 | - natural_width = MAX (priv->fixed_width, minimum_width); | ||
475 | 326 | + gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL); | ||
476 | 327 | + requested_width += priv->padding; | ||
477 | 328 | |||
478 | 329 | - if (priv->min_width != -1) | ||
479 | 330 | + gtk_widget_get_preferred_width (priv->button, &button_request, NULL); | ||
480 | 331 | + real_requested_width = MAX (requested_width, button_request); | ||
481 | 332 | + } | ||
482 | 333 | + else | ||
483 | 334 | { | ||
484 | 335 | - minimum_width = MAX (minimum_width, priv->min_width); | ||
485 | 336 | - natural_width = MAX (natural_width, priv->min_width); | ||
486 | 337 | + gint requested_width; | ||
487 | 338 | + | ||
488 | 339 | + gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL); | ||
489 | 340 | + requested_width += priv->padding; | ||
490 | 341 | + | ||
491 | 342 | + real_requested_width = requested_width; | ||
492 | 343 | + if (real_requested_width < 0) | ||
493 | 344 | + real_requested_width = 0; | ||
494 | 345 | } | ||
495 | 346 | |||
496 | 347 | + if (priv->min_width != -1) | ||
497 | 348 | + real_requested_width = MAX (real_requested_width, priv->min_width); | ||
498 | 349 | + | ||
499 | 350 | if (priv->max_width != -1) | ||
500 | 351 | - { | ||
501 | 352 | - minimum_width = MIN (minimum_width, priv->max_width); | ||
502 | 353 | - natural_width = MIN (natural_width, priv->max_width); | ||
503 | 354 | - } | ||
504 | 355 | + real_requested_width = MIN (real_requested_width, priv->max_width); | ||
505 | 356 | |||
506 | 357 | - if (minimum != NULL) | ||
507 | 358 | - *minimum = minimum_width; | ||
508 | 359 | - if (natural != NULL) | ||
509 | 360 | - *natural = natural_width; | ||
510 | 361 | + return real_requested_width; | ||
511 | 362 | } | ||
512 | 363 | |||
513 | 364 | void | ||
514 | 0 | 365 | ||
515 | === modified file 'debian/patches/series' | |||
516 | --- debian/patches/series 2015-01-15 15:01:30 +0000 | |||
517 | +++ debian/patches/series 2015-03-02 19:52:16 +0000 | |||
518 | @@ -24,3 +24,5 @@ | |||
519 | 24 | use-secrets-service-for-cups-auth_info.patch | 24 | use-secrets-service-for-cups-auth_info.patch |
520 | 25 | printing-initialize-auth_info.patch | 25 | printing-initialize-auth_info.patch |
521 | 26 | no_popup_menu_in_gtk_window.patch | 26 | no_popup_menu_in_gtk_window.patch |
522 | 27 | revert-use-minumum-natural-size-semantics.patch | ||
523 | 28 | revert-better-resize-of-expandable-columns.patch |
I tested this locally and it solves the issue and is working great!
But if anyone wants to test, it is building atm on this ppa: https:/ /launchpad. net/~hackedbell ini/+archive/ ubuntu/ misc