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

@ -36,6 +36,17 @@ struct _MetaWaylandSerial {
uint32_t value;
};
typedef enum
{
META_WAYLAND_SURFACE_ROLE_NONE,
META_WAYLAND_SURFACE_ROLE_SUBSURFACE,
META_WAYLAND_SURFACE_ROLE_XDG_SURFACE,
META_WAYLAND_SURFACE_ROLE_XDG_POPUP,
META_WAYLAND_SURFACE_ROLE_WL_SHELL_SURFACE,
META_WAYLAND_SURFACE_ROLE_CURSOR,
META_WAYLAND_SURFACE_ROLE_DND,
} MetaWaylandSurfaceRole;
typedef struct
{
/* wl_surface.attach */
@ -66,6 +77,7 @@ struct _MetaWaylandSurface
struct wl_resource *resource;
MetaWaylandCompositor *compositor;
MetaSurfaceActor *surface_actor;
MetaWaylandSurfaceRole role;
MetaWindow *window;
MetaWaylandBuffer *buffer;
struct wl_listener buffer_destroy_listener;
@ -118,6 +130,11 @@ MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *composit
struct wl_resource *compositor_resource,
guint32 id);
int meta_wayland_surface_set_role (MetaWaylandSurface *surface,
MetaWaylandSurfaceRole role,
struct wl_resource *error_resource,
uint32_t error_code);
void meta_wayland_surface_set_window (MetaWaylandSurface *surface,
MetaWindow *window);