[clutter] a11y: Not compute extents for actors without an stage



commit 6e78ebca957fe838508e6a02f6c9c312edd40f21
Author: Alejandro PiÃeiro <apinheiro igalia com>
Date:   Wed Feb 29 15:49:23 2012 +0100

    a11y: Not compute extents for actors without an stage
    
    This solves a crash on GNOME Shell, as compute the extents
    for some StWidgets could lead to call st_widget_get_theme_node,
    and it is a fatal error to call this on a widget that it not
    beed added to a stage.

 clutter/cally/cally-actor.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/clutter/cally/cally-actor.c b/clutter/cally/cally-actor.c
index 72babdb..81c94bc 100644
--- a/clutter/cally/cally-actor.c
+++ b/clutter/cally/cally-actor.c
@@ -668,6 +668,7 @@ cally_actor_get_extents (AtkComponent *component,
   gint          top_level_x, top_level_y;
   gfloat        f_width, f_height;
   ClutterVertex verts[4];
+  ClutterActor  *stage = NULL;
 
   g_return_if_fail (CALLY_IS_ACTOR (component));
 
@@ -677,6 +678,12 @@ cally_actor_get_extents (AtkComponent *component,
   if (actor == NULL) /* actor is defunct */
     return;
 
+  /* If the actor is not placed in any stage, we can't compute the
+   * extents */
+  stage = clutter_actor_get_stage (actor);
+  if (stage == NULL)
+    return;
+
   clutter_actor_get_abs_allocation_vertices (actor, verts);
   clutter_actor_get_transformed_size (actor, &f_width, &f_height);
 



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