summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2011-01-23 18:04:41 +0100
committerCarlos Garnacho <carlosg@gnome.org>2011-01-23 19:34:38 +0100
commita0e1fa9e77a0082afda4b86d2f50f78c54a00ee7 (patch)
tree0c8e9ffecc76439595a2ac106146750de385d3b5 /gtk/gtkbutton.c
parent74f7e08811bb69d27e067b46c815f504b8cc8f13 (diff)
downloadgtk+-a0e1fa9e77a0082afda4b86d2f50f78c54a00ee7.tar.gz
Gtk(Toggle)Button: preserve untouched state flags when updating state.
Partly fixes bug #640282, noticed by Christian Persch. buttons were clobbering the insensitive flag when updating their state.
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index baad6ebf29..d038b311ec 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2298,7 +2298,7 @@ static void
gtk_button_update_state (GtkButton *button)
{
GtkButtonPrivate *priv = button->priv;
- GtkStateFlags new_state = 0;
+ GtkStateFlags new_state;
gboolean depressed;
if (priv->activate_timeout)
@@ -2306,6 +2306,9 @@ gtk_button_update_state (GtkButton *button)
else
depressed = priv->in_button && priv->button_down;
+ new_state = gtk_widget_get_state_flags (GTK_WIDGET (button)) &
+ ~(GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_ACTIVE);
+
if (priv->in_button)
new_state |= GTK_STATE_FLAG_PRELIGHT;