Commit 0a4cfde4 authored by Owen W. Taylor's avatar Owen W. Taylor
Browse files

MetaWindowActor: Fix crashes when mapping and unmapping windows

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
parent c853d197
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment