mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-11 13:29:49 -05:00
Add new surface.map_transient() request to map a surface relative to another
This commit is contained in:
parent
d86a6bc96f
commit
8dc378ff76
2 changed files with 36 additions and 0 deletions
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue