Add new surface.map_transient() request to map a surface relative to another

This commit is contained in:
Kristian Høgsberg 2011-01-21 18:02:24 -05:00
parent d86a6bc96f
commit 8dc378ff76
2 changed files with 36 additions and 0 deletions

View File

@ -472,6 +472,26 @@ surface_map_toplevel(struct wl_client *client,
es->mapped = 1;
}
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,
@ -487,6 +507,7 @@ const static struct wl_surface_interface surface_interface = {
surface_destroy,
surface_attach,
surface_map_toplevel,
surface_map_transient,
surface_damage
};

View File

@ -341,6 +341,21 @@
<!-- Make the surface visible as a toplevel window. -->
<request name="map_toplevel"/>
<!-- Map the surface relative to an existing surface. The x and y
arguments specify the locations of the upper left corner of
the surface relative to the upper left corner of the parent
surface. The flags argument controls overflow/clipping
behaviour when the surface would intersect a screen edge,
panel or such. And possibly whether the offset only
determines the initial position or if the surface is locked
to that relative position during moves. -->
<request name="map_transient">
<arg name="parent" type="object" interface="surface"/>
<arg name="x" type="int"/>
<arg name="y" type="int"/>
<arg name="flags" type="uint"/>
</request>
<!-- Notify the server that the attached buffer's contents have
changed, and request a redraw. The arguments allow you to
damage only a part of the surface, but the server may ignore