diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2010-11-11 20:05:35 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2010-11-13 11:44:47 -0500 |
commit | 0a4cfde4e2d83d9044fb0368597e92321b402566 (patch) | |
tree | d4d9dd76329886b0e099f5aef9a62e28bd9477a3 | |
parent | c853d197e32cca3a49f876dd749d2d7892817abe (diff) | |
download | mutter-configurable-shadows.tar.gz |
MetaWindowActor: Fix crashes when mapping and unmapping windowsconfigurable-shadows
The assumptions made when getting the size of the window for the
paint volume turned out not to be accurate in all cases -
get_paint_volume() could be called on windows without computed
bounds.
https://bugzilla.gnome.org/show_bug.cgi?id=592382
-rw-r--r-- | src/compositor/meta-window-actor.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index e57516223..3ed16eb1a 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -629,10 +629,16 @@ meta_window_actor_get_shape_bounds (MetaWindowActor *self, { MetaWindowActorPrivate *priv = self->priv; - if (priv->shaped) + /* We need to be defensive here because there are corner cases + * where getting the shape fails on a window being destroyed + * and similar. + */ + if (priv->shaped && priv->shape_region) cairo_region_get_extents (priv->shape_region, bounds); - else + else if (priv->bounding_region) cairo_region_get_extents (priv->bounding_region, bounds); + else + bounds->x = bounds->y = bounds->width = bounds->height = 0; } static void @@ -695,6 +701,10 @@ meta_window_actor_get_paint_volume (ClutterActor *actor, gboolean appears_focused = meta_window_appears_focused (priv->window); ClutterVertex origin; + /* The paint volume is computed before paint functions are called + * so our bounds might not be updated yet. Force an update. */ + meta_window_actor_pre_paint (self); + meta_window_actor_get_shape_bounds (self, &bounds); if (appears_focused ? priv->focused_shadow : priv->unfocused_shadow) |