From 8dc378ff768e47858c34ae6e347ae3bac736d613 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 21 Jan 2011 18:02:24 -0500 Subject: [PATCH] Add new surface.map_transient() request to map a surface relative to another --- compositor/compositor.c | 21 +++++++++++++++++++++ protocol/wayland.xml | 15 +++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/compositor/compositor.c b/compositor/compositor.c index b1767ed..5199b9e 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -473,6 +473,26 @@ surface_map_toplevel(struct wl_client *client, } static void +surface_map_transient(struct wl_client *client, + struct wl_surface *surface, struct wl_surface *parent, + int x, int y, uint32_t flags) +{ + struct wlsc_surface *es = (struct wlsc_surface *) surface; + struct wlsc_surface *pes = (struct wlsc_surface *) parent; + + if (es->mapped) + return; + + es->x = pes->x + x; + es->y = pes->y + y; + + wlsc_surface_update_matrix(es); + wl_list_insert(&es->compositor->surface_list, &es->link); + wlsc_compositor_schedule_repaint(es->compositor); + es->mapped = 1; +} + +static void surface_damage(struct wl_client *client, struct wl_surface *surface, int32_t x, int32_t y, int32_t width, int32_t height) @@ -487,6 +507,7 @@ const static struct wl_surface_interface surface_interface = { surface_destroy, surface_attach, surface_map_toplevel, + surface_map_transient, surface_damage }; diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 75ccb5b..7f1a377 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -341,6 +341,21 @@ + + + + + + + +