mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
surface-actor: Add setters for set_input_region / set_opaque_region
Subsurfaces won't have a MetaWindow or MetaWindowActor to fetch these from, so they need to be tied directly to the MetaSurfaceActor.
This commit is contained in:
parent
a27744503b
commit
025ab35af7
@ -164,3 +164,17 @@ meta_surface_actor_set_texture (MetaSurfaceActor *self,
|
||||
{
|
||||
meta_shaped_texture_set_texture (self->priv->texture, texture);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_set_input_region (MetaSurfaceActor *self,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
meta_shaped_texture_set_input_shape_region (self->priv->texture, region);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
|
||||
cairo_region_t *region)
|
||||
{
|
||||
meta_shaped_texture_set_opaque_region (self->priv->texture, region);
|
||||
}
|
||||
|
@ -57,6 +57,10 @@ void meta_surface_actor_set_texture (MetaSurfaceActor *self,
|
||||
CoglTexture *texture);
|
||||
void meta_surface_actor_attach_wayland_buffer (MetaSurfaceActor *self,
|
||||
MetaWaylandBuffer *buffer);
|
||||
void meta_surface_actor_set_input_region (MetaSurfaceActor *self,
|
||||
cairo_region_t *region);
|
||||
void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
|
||||
cairo_region_t *region);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -2357,12 +2357,8 @@ meta_window_actor_update_input_region (MetaWindowActor *self,
|
||||
cairo_rectangle_int_t *client_area)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (priv->surface);
|
||||
cairo_region_t *region = NULL;
|
||||
|
||||
if (!stex)
|
||||
return;
|
||||
|
||||
if (priv->window->frame != NULL && priv->window->input_region != NULL)
|
||||
{
|
||||
region = meta_frame_get_frame_bounds (priv->window->frame);
|
||||
@ -2387,7 +2383,7 @@ meta_window_actor_update_input_region (MetaWindowActor *self,
|
||||
region = cairo_region_create_rectangle (client_area);
|
||||
}
|
||||
|
||||
meta_shaped_texture_set_input_shape_region (stex, region);
|
||||
meta_surface_actor_set_input_region (priv->surface, region);
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
@ -2395,13 +2391,8 @@ static void
|
||||
meta_window_actor_update_opaque_region (MetaWindowActor *self)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaShapedTexture *stex;
|
||||
cairo_region_t *opaque_region;
|
||||
|
||||
stex = meta_surface_actor_get_texture (priv->surface);
|
||||
if (!stex)
|
||||
return;
|
||||
|
||||
if (priv->argb32 && priv->window->opaque_region != NULL)
|
||||
{
|
||||
MetaFrameBorders borders;
|
||||
@ -2427,7 +2418,7 @@ meta_window_actor_update_opaque_region (MetaWindowActor *self)
|
||||
else
|
||||
opaque_region = cairo_region_reference (priv->shape_region);
|
||||
|
||||
meta_shaped_texture_set_opaque_region (stex, opaque_region);
|
||||
meta_surface_actor_set_opaque_region (priv->surface, opaque_region);
|
||||
cairo_region_destroy (opaque_region);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user