widget: Flip the sensitive flag even if the state doesn't change

Even if we can't change our sensitivity because the parent is insensitive we
should still flip the sensitive flag. Otherwise, with and insensitive parent,

child.set_sensitive(True)
...
parent.set_sensitive(True)

would result in child still being insensitive.

https://bugzilla.gnome.org/show_bug.cgi?id=666392
This commit is contained in:
Rui Matos 2011-12-16 23:46:19 +00:00
parent b9fad15ee6
commit 9d6da33ff5

View File

@ -7673,6 +7673,8 @@ gtk_widget_set_sensitive (GtkWidget *widget,
if (priv->sensitive == sensitive)
return;
priv->sensitive = sensitive;
if (priv->parent == NULL
|| gtk_widget_is_sensitive (priv->parent))
{
@ -7681,15 +7683,9 @@ gtk_widget_set_sensitive (GtkWidget *widget,
data.flags = GTK_STATE_FLAG_INSENSITIVE;
if (sensitive)
{
priv->sensitive = TRUE;
data.operation = STATE_CHANGE_UNSET;
}
data.operation = STATE_CHANGE_UNSET;
else
{
priv->sensitive = FALSE;
data.operation = STATE_CHANGE_SET;
}
data.operation = STATE_CHANGE_SET;
data.use_forall = TRUE;