wayland: Introduce MetaWaylandSurfaceRole

Introduce surface roles and use it to ensure a surface never changes
role.

https://bugzilla.gnome.org/show_bug.cgi?id=744452
This commit is contained in:
Jonas Ådahl
2015-02-06 16:12:21 +08:00
parent f6869bbbc2
commit 945bf626c6
4 changed files with 77 additions and 0 deletions

View File

@@ -786,6 +786,15 @@ pointer_set_cursor (struct wl_client *client,
if (pointer->focus_serial - serial > G_MAXUINT32 / 2)
return;
if (surface)
{
if (meta_wayland_surface_set_role (surface,
META_WAYLAND_SURFACE_ROLE_CURSOR,
resource,
WL_POINTER_ERROR_ROLE) != 0)
return;
}
pointer->hotspot_x = x;
pointer->hotspot_y = y;
set_cursor_surface (pointer, surface);