shell: Expose set_transient in shell interface

Tiago Vignatti 13 years ago committed by Kristian Høgsberg
parent 5cbb9c8a6b
commit 491bac19c7
  1. 3
      src/compositor.h
  2. 21
      src/shell.c

@ -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);
};

@ -138,6 +138,7 @@ struct shell_surface {
struct {
int32_t x, y;
uint32_t flags;
} transient;
struct {
@ -822,6 +823,18 @@ shell_surface_set_toplevel(struct wl_client *client,
set_toplevel(surface);
}
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,
@ -829,12 +842,9 @@ shell_surface_set_transient(struct wl_client *client,
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);

Loading…
Cancel
Save