diff --git a/src/compositor/meta-window-actor-private.h b/src/compositor/meta-window-actor-private.h index 396e84a8a..24a4cfcb6 100644 --- a/src/compositor/meta-window-actor-private.h +++ b/src/compositor/meta-window-actor-private.h @@ -86,5 +86,6 @@ void meta_window_actor_assign_surface_actor (MetaWindowActor *self, MetaSurfaceActor *surface_actor); MetaWindowActor *meta_window_actor_from_window (MetaWindow *window); +MetaWindowActor *meta_window_actor_from_actor (ClutterActor *actor); #endif /* META_WINDOW_ACTOR_PRIVATE_H */ diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index f558bfd1b..84c282e18 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -2035,3 +2035,21 @@ screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface) iface->capture_into = meta_window_actor_capture_into; iface->has_damage = meta_window_actor_has_damage; } + +MetaWindowActor * +meta_window_actor_from_actor (ClutterActor *actor) +{ + if (!META_IS_SURFACE_ACTOR (actor)) + return NULL; + + do + { + actor = clutter_actor_get_parent (actor); + + if (META_IS_WINDOW_ACTOR (actor)) + return META_WINDOW_ACTOR (actor); + } + while (actor != NULL); + + return NULL; +}