MetaSurfaceActor: add a generic hook to retrieve the MetaWindow

This way we can find the window for a ClutterEvent even when
running as an x11 compositor.
This commit is contained in:
Giovanni Campagna
2014-02-27 02:21:51 +01:00
parent 394b44a2c2
commit 360d423faa
5 changed files with 32 additions and 6 deletions

View File

@ -1693,12 +1693,8 @@ get_window_for_event (MetaDisplay *display,
}
source = clutter_event_get_source (event);
if (META_IS_SURFACE_ACTOR_WAYLAND (source))
{
MetaWaylandSurface *surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (source));
g_assert (surface != NULL);
return surface->window;
}
if (META_IS_SURFACE_ACTOR (source))
return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
return NULL;
}