mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 22:10:08 +00:00
menubutton: clear arrow_widget on remove()
So that we clear its pointer also in case somebody else calls gtk_container_remove() on the button. Fixes criticals at startup in e.g. Nautilus.
This commit is contained in:
parent
f2ab3af20a
commit
143a600466
@ -445,14 +445,23 @@ gtk_menu_button_add (GtkContainer *container,
|
|||||||
GtkMenuButton *button = GTK_MENU_BUTTON (container);
|
GtkMenuButton *button = GTK_MENU_BUTTON (container);
|
||||||
|
|
||||||
if (button->priv->arrow_widget)
|
if (button->priv->arrow_widget)
|
||||||
{
|
gtk_container_remove (container, button->priv->arrow_widget);
|
||||||
gtk_container_remove (container, button->priv->arrow_widget);
|
|
||||||
button->priv->arrow_widget = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
GTK_CONTAINER_CLASS (gtk_menu_button_parent_class)->add (container, child);
|
GTK_CONTAINER_CLASS (gtk_menu_button_parent_class)->add (container, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_menu_button_remove (GtkContainer *container,
|
||||||
|
GtkWidget *child)
|
||||||
|
{
|
||||||
|
GtkMenuButton *button = GTK_MENU_BUTTON (container);
|
||||||
|
|
||||||
|
if (child == button->priv->arrow_widget)
|
||||||
|
button->priv->arrow_widget = NULL;
|
||||||
|
|
||||||
|
GTK_CONTAINER_CLASS (gtk_menu_button_parent_class)->remove (container, child);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_menu_button_class_init (GtkMenuButtonClass *klass)
|
gtk_menu_button_class_init (GtkMenuButtonClass *klass)
|
||||||
{
|
{
|
||||||
@ -471,6 +480,7 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
|
|||||||
widget_class->button_press_event = gtk_menu_button_button_press_event;
|
widget_class->button_press_event = gtk_menu_button_button_press_event;
|
||||||
|
|
||||||
container_class->add = gtk_menu_button_add;
|
container_class->add = gtk_menu_button_add;
|
||||||
|
container_class->remove = gtk_menu_button_remove;
|
||||||
|
|
||||||
toggle_button_class->toggled = gtk_menu_button_toggled;
|
toggle_button_class->toggled = gtk_menu_button_toggled;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user