summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2019-05-31 03:20:50 +0000
committerMatthias Clasen <mclasen@redhat.com>2019-05-31 23:36:35 +0000
commit8ba3c7568264214bd8a069dc6a9d5d01f943dc38 (patch)
treedbdd9f7ef7afe199fe57ca9be8b06ac0e5168e18 /gtk/gtkcombobox.c
parent3f6272f56eb7b7d32aad1979c67a744a14aa02ed (diff)
downloadgtk+-8ba3c7568264214bd8a069dc6a9d5d01f943dc38.tar.gz
More menu work
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 3d8afc863b..ea8c1f6968 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -1228,7 +1228,7 @@ update_menu_sensitivity (GtkComboBox *combo_box,
if (!priv->model)
return;
- children = gtk_container_get_children (GTK_CONTAINER (menu));
+ children = gtk_menu_shell_get_items (GTK_MENU_SHELL (menu));
for (child = children; child; child = child->next)
{
@@ -1321,20 +1321,24 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box)
if (!(active && gtk_widget_get_visible (active)))
{
- for (i = GTK_MENU_SHELL (priv->popup_widget)->priv->children; i && !active; i = i->next)
+ GList *children;
+ children = gtk_menu_shell_get_items (GTK_MENU_SHELL (priv->popup_widget));
+ for (i = children; i && !active; i = i->next)
{
child = i->data;
if (child && gtk_widget_get_visible (child))
active = child;
}
+ g_list_free (children);
}
if (active)
{
gint child_height;
-
- for (i = GTK_MENU_SHELL (priv->popup_widget)->priv->children; i && i->data != active; i = i->next)
+ GList *children;
+ children = gtk_menu_shell_get_items (GTK_MENU_SHELL (priv->popup_widget));
+ for (i = children; i && i->data != active; i = i->next)
{
child = i->data;
@@ -1345,6 +1349,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box)
rect_anchor_dy -= child_height;
}
}
+ g_list_free (children);
gtk_widget_measure (active, GTK_ORIENTATION_VERTICAL, -1,
&child_height, NULL, NULL, NULL);