[clutter/deprecate-default-stage: 9/12] cally/actor: Do not use the default stage as a fallback



commit 6ebb5bd3737901197ef3215f19bfdbae20792eaf
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Nov 9 17:03:30 2011 +0000

    cally/actor: Do not use the default stage as a fallback
    
    Using the default stage as a fallback is wrong in all circumstances.
    
    In this specific case, if an actor is not associated to a stage then it
    cannot possibly be the key focus.

 clutter/cally/cally-actor.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/clutter/cally/cally-actor.c b/clutter/cally/cally-actor.c
index b3bf24f..73b972f 100644
--- a/clutter/cally/cally-actor.c
+++ b/clutter/cally/cally-actor.c
@@ -551,14 +551,12 @@ cally_actor_ref_state_set (AtkObject *obj)
       atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE);
 
       stage = CLUTTER_STAGE (clutter_actor_get_stage (actor));
-      /* If for any reason this actor doesn't have a stage
-         associated, we try the default one as fallback */
-      if (stage == NULL)
-          stage = CLUTTER_STAGE (clutter_stage_get_default ());
-
-      focus_actor = clutter_stage_get_key_focus (stage);
-      if (focus_actor == actor)
-        atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
+      if (stage != NULL)
+        {
+          focus_actor = clutter_stage_get_key_focus (stage);
+          if (focus_actor == actor)
+            atk_state_set_add_state (state_set, ATK_STATE_FOCUSED);
+        }
     }
 
   return state_set;



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