wayland: Always set the new buffer on the surface on commit

Even when it doesn't have a role.

This fixes cursors not quite working right, as they're a "detached"
surface without a role since nobody called set_cursor on them yet.
This commit is contained in:
Jasper St. Pierre 2014-04-11 23:29:05 -07:00
parent f0bf9c7fc3
commit dbe4fc0e45

View File

@ -145,20 +145,10 @@ ensure_buffer_texture (MetaWaylandBuffer *buffer)
buffer->texture = texture;
}
static void
commit_attached_buffer (MetaWaylandSurface *surface,
MetaWaylandDoubleBufferedState *pending)
{
if (pending->newly_attached)
surface_set_buffer (surface, pending->buffer);
}
static void
cursor_surface_commit (MetaWaylandSurface *surface,
MetaWaylandDoubleBufferedState *pending)
{
commit_attached_buffer (surface, pending);
if (pending->newly_attached)
meta_wayland_seat_update_cursor_surface (surface->compositor->seat);
}
@ -169,8 +159,6 @@ actor_surface_commit (MetaWaylandSurface *surface,
{
MetaSurfaceActor *surface_actor = surface->surface_actor;
commit_attached_buffer (surface, pending);
if (pending->newly_attached && pending->buffer)
{
ensure_buffer_texture (pending->buffer);
@ -356,6 +344,9 @@ commit_double_buffered_state (MetaWaylandSurface *surface,
{
MetaWaylandCompositor *compositor = surface->compositor;
if (pending->newly_attached)
surface_set_buffer (surface, pending->buffer);
if (surface == compositor->seat->cursor_surface)
cursor_surface_commit (surface, pending);
else if (surface->window)