[gtk+] widget: Flip the sensitive flag even if the state doesn't change
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Flip the sensitive flag even if the state doesn't change
- Date: Sat, 17 Dec 2011 12:02:04 +0000 (UTC)
commit 9d6da33ff5c5e41e3521e1afd63d2d67bc915753
Author: Rui Matos <tiagomatos gmail com>
Date: Fri Dec 16 23:46:19 2011 +0000
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
gtk/gtkwidget.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 7c189c4..535da26 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]