From: Tiago Vignatti Date: Fri, 18 May 2012 20:37:43 +0000 (-0400) Subject: shell: Expose set_transient in shell interface X-Git-Tag: 20120702.1049~154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=491bac19c7c32c62ac5bbe48f0064b55586a8a4a;p=profile%2Fivi%2Fweston.git shell: Expose set_transient in shell interface --- diff --git a/src/compositor.h b/src/compositor.h index 1d3e060..0ba51d7 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -63,6 +63,9 @@ struct weston_shell_interface { struct shell_surface **ret); void (*set_toplevel)(struct shell_surface *shsurf); + void (*set_transient)(struct shell_surface *shsurf, + struct shell_surface *pshsurf, + int x, int y, uint32_t flags); int (*move)(struct shell_surface *shsurf, struct weston_seat *ws); }; diff --git a/src/shell.c b/src/shell.c index 9740507..52c21e5 100644 --- a/src/shell.c +++ b/src/shell.c @@ -138,6 +138,7 @@ struct shell_surface { struct { int32_t x, y; + uint32_t flags; } transient; struct { @@ -823,18 +824,27 @@ shell_surface_set_toplevel(struct wl_client *client, } static void +set_transient(struct shell_surface *shsurf, + struct shell_surface *pshsurf, int x, int y, uint32_t flags) +{ + /* assign to parents output */ + shsurf->parent = pshsurf; + shsurf->transient.x = x; + shsurf->transient.y = y; + shsurf->transient.flags = flags; + shsurf->next_type = SHELL_SURFACE_TRANSIENT; +} + +static void shell_surface_set_transient(struct wl_client *client, struct wl_resource *resource, struct wl_resource *parent_resource, int x, int y, uint32_t flags) { struct shell_surface *shsurf = resource->data; + struct shell_surface *pshsurf = parent_resource->data; - /* assign to parents output */ - shsurf->parent = parent_resource->data; - shsurf->transient.x = x; - shsurf->transient.y = y; - shsurf->next_type = SHELL_SURFACE_TRANSIENT; + set_transient(shsurf, pshsurf, x, y, flags); } static struct desktop_shell * @@ -2608,6 +2618,7 @@ shell_init(struct weston_compositor *ec) ec->ping_handler = ping_handler; ec->shell_interface.create_shell_surface = create_shell_surface; ec->shell_interface.set_toplevel = set_toplevel; + ec->shell_interface.set_transient = set_transient; ec->shell_interface.move = surface_move; wl_list_init(&shell->backgrounds);