shell: Expose set_transient in shell interface
authorTiago Vignatti <tiago.vignatti@intel.com>
Fri, 18 May 2012 20:37:43 +0000 (16:37 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 18 May 2012 20:37:43 +0000 (16:37 -0400)
src/compositor.h
src/shell.c

index 1d3e060..0ba51d7 100644 (file)
@@ -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);
 };
 
index 9740507..52c21e5 100644 (file)
@@ -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);