From: Michael Hofmann Date: Sun, 17 Feb 2013 15:01:06 +0000 (+0100) Subject: GtkColorChooserWidget: deselect swatch before removing palettes X-Git-Url: http://pileus.org/git/?p=~andy%2Fgtk;a=commitdiff_plain;h=670e532a6ba528f3b1b9a359a05cec80da94ebd9 GtkColorChooserWidget: deselect swatch before removing palettes When adding custom palettes, set the current swatch to NULL if the palette it is on is going to be removed. https://bugzilla.gnome.org/show_bug.cgi?id=693995 --- diff --git a/gtk/gtkcolorchooserwidget.c b/gtk/gtkcolorchooserwidget.c index be954a266..8e6cf2c82 100644 --- a/gtk/gtkcolorchooserwidget.c +++ b/gtk/gtkcolorchooserwidget.c @@ -296,6 +296,10 @@ remove_palette (GtkColorChooserWidget *cc) GList *children, *l; GtkWidget *widget; + if (cc->priv->current != NULL && + gtk_widget_get_parent (GTK_WIDGET (cc->priv->current)) != cc->priv->custom) + cc->priv->current = NULL; + children = gtk_container_get_children (GTK_CONTAINER (cc->priv->palette)); for (l = children; l; l = l->next) {