mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
window-actor: Add API to get a MetaWindowActor from a ClutterActor
Make it so it returns the closest ancestry MetaWindowActor if it is a MetaSurfaceActor. We need this for Wayland subsurfaces, so we can support actions like Meta+Drag on them. https://gitlab.gnome.org/GNOME/mutter/merge_requests/604
This commit is contained in:
parent
57772e5850
commit
73bc3c4426
@ -86,5 +86,6 @@ void meta_window_actor_assign_surface_actor (MetaWindowActor *self,
|
|||||||
MetaSurfaceActor *surface_actor);
|
MetaSurfaceActor *surface_actor);
|
||||||
|
|
||||||
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
|
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
|
||||||
|
MetaWindowActor *meta_window_actor_from_actor (ClutterActor *actor);
|
||||||
|
|
||||||
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
|
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
|
||||||
|
@ -2035,3 +2035,21 @@ screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
|
|||||||
iface->capture_into = meta_window_actor_capture_into;
|
iface->capture_into = meta_window_actor_capture_into;
|
||||||
iface->has_damage = meta_window_actor_has_damage;
|
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;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user