mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
Ignore surface.map_toplevel() if already mapped
This commit is contained in:
parent
175e6cec39
commit
8f66a57b4d
3 changed files with 7 additions and 1 deletions
|
|
@ -130,6 +130,7 @@ wlsc_surface_create(struct wlsc_compositor *compositor,
|
||||||
|
|
||||||
wl_list_init(&surface->surface.destroy_listener_list);
|
wl_list_init(&surface->surface.destroy_listener_list);
|
||||||
wl_list_init(&surface->link);
|
wl_list_init(&surface->link);
|
||||||
|
surface->mapped = 0;
|
||||||
|
|
||||||
glGenTextures(1, &surface->texture);
|
glGenTextures(1, &surface->texture);
|
||||||
glBindTexture(GL_TEXTURE_2D, surface->texture);
|
glBindTexture(GL_TEXTURE_2D, surface->texture);
|
||||||
|
|
@ -440,12 +441,16 @@ surface_map_toplevel(struct wl_client *client,
|
||||||
{
|
{
|
||||||
struct wlsc_surface *es = (struct wlsc_surface *) surface;
|
struct wlsc_surface *es = (struct wlsc_surface *) surface;
|
||||||
|
|
||||||
|
if (es->mapped)
|
||||||
|
return;
|
||||||
|
|
||||||
es->x = 10 + random() % 400;
|
es->x = 10 + random() % 400;
|
||||||
es->y = 10 + random() % 400;
|
es->y = 10 + random() % 400;
|
||||||
|
|
||||||
wlsc_surface_update_matrix(es);
|
wlsc_surface_update_matrix(es);
|
||||||
wl_list_insert(es->compositor->surface_list.prev, &es->link);
|
wl_list_insert(es->compositor->surface_list.prev, &es->link);
|
||||||
wlsc_compositor_schedule_repaint(es->compositor);
|
wlsc_compositor_schedule_repaint(es->compositor);
|
||||||
|
es->mapped = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ struct wlsc_surface {
|
||||||
struct wlsc_matrix matrix_inv;
|
struct wlsc_matrix matrix_inv;
|
||||||
struct wl_visual *visual;
|
struct wl_visual *visual;
|
||||||
struct wl_buffer *buffer;
|
struct wl_buffer *buffer;
|
||||||
|
int mapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue