mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
wayland-surface: Make _set_surface api public
This exposes a clutter_wayland_surface_set_surface() function. The implementation ignores requests to re-set the same surface and since now has code to cleanup old surface state before setting the new surface. (previously the surface was construct only so this wasn't necessary) Reviewed-by: Neil Roberts <neil@linux.intel.com> Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
862eebceb6
commit
83b94ec27d
@ -223,7 +223,19 @@ clutter_wayland_surface_set_surface (ClutterWaylandSurface *self,
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
g_return_if_fail (priv->surface == NULL);
|
||||
if (priv->surface == surface)
|
||||
return;
|
||||
|
||||
if (priv->surface)
|
||||
{
|
||||
free_pipeline (self);
|
||||
free_surface_buffers (self);
|
||||
clutter_wayland_surface_queue_damage_redraw (self,
|
||||
0, 0,
|
||||
priv->width,
|
||||
priv->height);
|
||||
}
|
||||
|
||||
priv->surface = surface;
|
||||
|
||||
/* XXX: should we freeze/thaw notifications? */
|
||||
|
@ -79,6 +79,8 @@ struct _ClutterWaylandSurfaceClass
|
||||
GType clutter_wayland_surface_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterActor *clutter_wayland_surface_new (struct wl_surface *surface);
|
||||
void clutter_wayland_surface_set_surface (ClutterWaylandSurface *self,
|
||||
struct wl_surface *surface);
|
||||
gboolean clutter_wayland_surface_attach_buffer (ClutterWaylandSurface *self,
|
||||
struct wl_buffer *buffer,
|
||||
GError **error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user