diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2013-03-04 12:11:41 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-03-05 15:35:47 -0500 |
commit | e7144fd175d1d68b91aa0cec7ab63381b79385a9 (patch) | |
tree | 8219c558551e550d592cd6eec33d71d81265eb34 /clients | |
parent | 2034780cb25c21e930796817f1a1b9dc17f653a3 (diff) |
compositor: Only send release event in response to wl_surface.attach
The current semantics would implicitly attach the most recently attached
buffer at commit time and send a release event when the buffer enventually
was released. The implicit attach is a little too subtle though and this
patch changes the semantics to always only send release events in response
to an attach event. As a consequence, once a compositor releases a buffer,
it no longer has a reference to it and wl_surfcea.damage is undefined.
Thus, the client side visible change is that damage request must always
be preceeded by a wl_surface.attach request, to ensure there's a valid buffer,
even if that means attaching the same buffer again.
Diffstat (limited to 'clients')
-rw-r--r-- | clients/simple-shm.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clients/simple-shm.c b/clients/simple-shm.c index c2eda617..f187b102 100644 --- a/clients/simple-shm.c +++ b/clients/simple-shm.c @@ -269,11 +269,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time) paint_pixels(buffer->shm_data, 20, window->width, window->height, time); - if (window->prev_buffer != buffer) { - wl_surface_attach(window->surface, buffer->buffer, 0, 0); - window->prev_buffer = buffer; - } - + wl_surface_attach(window->surface, buffer->buffer, 0, 0); wl_surface_damage(window->surface, 20, 20, window->width - 40, window->height - 40); |