mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 09:08:33 +02:00
compositor: do not release if re-attaching buffer
If a client called wl_surface.attach with the same wl_buffer as previously, the compositor would mistakenly send a release on that buffer. This will cause problems only when clients start to properly use the wl_buffer.release event. Do not send wl_buffer.release if the same buffer is attached again. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
246b965128
commit
ce6d79e665
1 changed files with 5 additions and 3 deletions
|
|
@ -810,16 +810,18 @@ weston_surface_destroy(struct weston_surface *surface)
|
|||
static void
|
||||
weston_surface_attach(struct weston_surface *surface, struct wl_buffer *buffer)
|
||||
{
|
||||
if (surface->buffer) {
|
||||
if (surface->buffer && buffer != surface->buffer) {
|
||||
weston_buffer_post_release(surface->buffer);
|
||||
wl_list_remove(&surface->buffer_destroy_listener.link);
|
||||
}
|
||||
|
||||
if (buffer) {
|
||||
if (buffer && buffer != surface->buffer) {
|
||||
buffer->busy_count++;
|
||||
wl_signal_add(&buffer->resource.destroy_signal,
|
||||
&surface->buffer_destroy_listener);
|
||||
} else {
|
||||
}
|
||||
|
||||
if (!buffer) {
|
||||
if (weston_surface_is_mapped(surface))
|
||||
weston_surface_unmap(surface);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue