surface-actor: Allow checking if a surface actor covers a rect

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
Dor Askayo 2022-06-14 01:04:03 +03:00 committed by Marge Bot
parent f5e5032eac
commit 4e5ac0186c
2 changed files with 19 additions and 0 deletions

View File

@ -537,6 +537,22 @@ meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
stage_view); stage_view);
} }
gboolean
meta_surface_actor_contains_rect (MetaSurfaceActor *surface_actor,
MtkRectangle *rect)
{
ClutterActor *actor = CLUTTER_ACTOR (surface_actor);
graphene_rect_t bounding_rect;
graphene_rect_t bound_rect;
clutter_actor_get_transformed_extents (actor, &bounding_rect);
bound_rect = mtk_rectangle_to_graphene_rect (rect);
return graphene_rect_contains_rect (&bounding_rect,
&bound_rect);
}
void void
meta_surface_actor_set_input_region (MetaSurfaceActor *self, meta_surface_actor_set_input_region (MetaSurfaceActor *self,
MtkRegion *region) MtkRegion *region)

View File

@ -40,6 +40,9 @@ gboolean meta_surface_actor_is_obscured_on_stage_view (MetaSurfaceActor *self,
ClutterStageView *stage_view, ClutterStageView *stage_view,
float *unobscurred_fraction); float *unobscurred_fraction);
gboolean meta_surface_actor_contains_rect (MetaSurfaceActor *surface_actor,
MtkRectangle *rect);
void meta_surface_actor_set_input_region (MetaSurfaceActor *self, void meta_surface_actor_set_input_region (MetaSurfaceActor *self,
MtkRegion *region); MtkRegion *region);
void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self, void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,