diff --git a/ChangeLog b/ChangeLog index 3c132289a4..0a1c754e97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-12-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a + last item to gtk_combo_box_relayout_item. (#161050, John Finlay) + * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename a local variable to avoid a conflict. (#161109, Robert Ögren) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3c132289a4..0a1c754e97 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-12-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a + last item to gtk_combo_box_relayout_item. (#161050, John Finlay) + * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename a local variable to avoid a conflict. (#161109, Robert Ögren) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3c132289a4..0a1c754e97 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-12-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a + last item to gtk_combo_box_relayout_item. (#161050, John Finlay) + * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename a local variable to avoid a conflict. (#161109, Robert Ögren) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3c132289a4..0a1c754e97 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-12-12 Matthias Clasen + * gtk/gtkcombobox.c (gtk_combo_box_menu_row_changed): Pass a + last item to gtk_combo_box_relayout_item. (#161050, John Finlay) + * tests/testfilechooserbutton.c (tests_button_clicked_cb): Rename a local variable to avoid a conflict. (#161109, Robert Ögren) diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 0d349037cf..f0acdd1b5c 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3056,7 +3056,29 @@ gtk_combo_box_menu_row_changed (GtkTreeModel *model, if (combo_box->priv->wrap_width && item->parent == combo_box->priv->popup_widget) - gtk_combo_box_relayout_item (combo_box, item, iter, NULL); + { + GtkWidget *pitem = NULL; + GtkTreePath *prev; + + prev = gtk_tree_path_copy (path); + + if (gtk_tree_path_prev (prev)) + pitem = find_menu_by_path (combo_box->priv->popup_widget, prev, FALSE); + + gtk_tree_path_free (prev); + + /* unattach item so gtk_combo_box_relayout_item() won't spuriously + move it */ + gtk_container_child_set (GTK_CONTAINER (combo_box->priv->popup_widget), + item, + "left_attach", -1, + "right_attach", -1, + "top_attach", -1, + "bottom_attach", -1, + NULL); + + gtk_combo_box_relayout_item (combo_box, item, iter, pitem); + } width = gtk_combo_box_calc_requested_width (combo_box, path);