mirror of
https://github.com/brl/mutter.git
synced 2025-01-08 10:42:33 +00:00
window-actor: Add a missing NULL-check
We shouldn't crash on a NULL-clip. https://gitlab.gnome.org/GNOME/mutter/merge_requests/856
This commit is contained in:
parent
ff885fea31
commit
c0037305eb
@ -2183,21 +2183,25 @@ meta_window_actor_get_image (MetaWindowActor *self,
|
|||||||
if (clutter_actor_get_n_children (actor) == 1)
|
if (clutter_actor_get_n_children (actor) == 1)
|
||||||
{
|
{
|
||||||
MetaShapedTexture *stex;
|
MetaShapedTexture *stex;
|
||||||
MetaRectangle surface_clip;
|
MetaRectangle *surface_clip = NULL;
|
||||||
int geometry_scale;
|
|
||||||
|
|
||||||
geometry_scale =
|
if (clip)
|
||||||
meta_window_actor_get_geometry_scale (self);
|
{
|
||||||
|
|
||||||
surface_clip = (MetaRectangle) {
|
int geometry_scale;
|
||||||
.x = clip->x / geometry_scale,
|
|
||||||
.y = clip->y / geometry_scale,
|
geometry_scale =
|
||||||
.width = clip->width / geometry_scale,
|
meta_window_actor_get_geometry_scale (self);
|
||||||
.height = clip->height / geometry_scale,
|
|
||||||
};
|
surface_clip = g_alloca (sizeof (MetaRectangle));
|
||||||
|
surface_clip->x = clip->x / geometry_scale,
|
||||||
|
surface_clip->y = clip->y / geometry_scale;
|
||||||
|
surface_clip->width = clip->width / geometry_scale;
|
||||||
|
surface_clip->height = clip->height / geometry_scale;
|
||||||
|
}
|
||||||
|
|
||||||
stex = meta_surface_actor_get_texture (priv->surface);
|
stex = meta_surface_actor_get_texture (priv->surface);
|
||||||
return meta_shaped_texture_get_image (stex, &surface_clip);
|
return meta_shaped_texture_get_image (stex, surface_clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
clutter_actor_get_size (actor, &width, &height);
|
clutter_actor_get_size (actor, &width, &height);
|
||||||
|
Loading…
Reference in New Issue
Block a user