MetaWaylandSurface: Allow passing parameters when assigning role

Allow passing parameters (only GObject parameters supported for now) so
that role assignment can affect the paremeters set during construction.

If a role was already assigned when assigning, the passed parameters
are set using g_object_set_valist().

https://bugzilla.gnome.org/show_bug.cgi?id=769936
This commit is contained in:
Jonas Ådahl
2016-01-28 17:14:06 +08:00
parent 2114f2eb9f
commit 3b3f40a1aa
8 changed files with 106 additions and 11 deletions

View File

@ -767,7 +767,8 @@ xdg_shell_get_xdg_surface (struct wl_client *client,
return;
}
if (!meta_wayland_surface_assign_role (surface, META_TYPE_WAYLAND_XDG_SURFACE))
if (!meta_wayland_surface_assign_role (surface, META_TYPE_WAYLAND_XDG_SURFACE,
NULL))
{
wl_resource_post_error (resource, XDG_SHELL_ERROR_ROLE,
"wl_surface@%d already has a different role",
@ -821,7 +822,8 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
return;
}
if (!meta_wayland_surface_assign_role (surface, META_TYPE_WAYLAND_XDG_POPUP))
if (!meta_wayland_surface_assign_role (surface, META_TYPE_WAYLAND_XDG_POPUP,
NULL))
{
wl_resource_post_error (resource, XDG_SHELL_ERROR_ROLE,
"wl_surface@%d already has a different role",