[gtk+] Simplify GTK_STATE_FLAG_FOCUSED handling in state propagation.



commit b3ba85a01c71067fbe4c99bee318424d767f12cb
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jan 23 18:37:14 2011 +0100

    Simplify GTK_STATE_FLAG_FOCUSED handling in state propagation.
    
    Just unsetting it before propagating to the children suffices.

 gtk/gtkwidget.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 7090dc6..37316be 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6972,14 +6972,6 @@ _gtk_widget_update_state_flags (GtkWidget     *widget,
   if (operation != STATE_CHANGE_REPLACE)
     flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
 
-  /* Focused state is meant to be set only on the widget
-   * being changed itself, not on the children */
-  if ((flags & GTK_STATE_FLAG_FOCUSED) !=
-      (priv->state_flags & GTK_STATE_FLAG_FOCUSED))
-    priv->state_flags |= GTK_STATE_FLAG_FOCUSED;
-
-  flags &= ~(GTK_STATE_FLAG_FOCUSED);
-
   if (flags != 0 ||
       operation == STATE_CHANGE_REPLACE)
     {
@@ -11266,7 +11258,7 @@ gtk_widget_propagate_state (GtkWidget           *widget,
           data->parent_sensitive = gtk_widget_is_sensitive (widget);
 
           /* Do not propagate insensitive state further */
-          data->flags &= ~(GTK_STATE_FLAG_INSENSITIVE);
+          data->flags &= ~(GTK_STATE_FLAG_INSENSITIVE | GTK_STATE_FLAG_FOCUSED);
 
           if (data->use_forall)
             gtk_container_forall (GTK_CONTAINER (widget),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]