From a85b4fb6ac62189c6a67371c164def0e5ccd527a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 20 Jun 2012 09:24:35 -0400 Subject: [PATCH] compositor: flush the batched up damage when shm buffer is destroyed Since we now batch up damage and only handle it at repaint time, we need to apply it in case a buffer is destroyed so we don't lose it. Ander found the problem, but we need to fix it in the compositor so we don't change the behavior of the compositor. --- src/compositor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index a8ace9c5..48b26a5a 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -179,6 +179,9 @@ weston_client_launch(struct weston_compositor *compositor, return client; } +static void +update_shm_texture(struct weston_surface *surface); + static void surface_handle_buffer_destroy(struct wl_listener *listener, void *data) { @@ -186,6 +189,9 @@ surface_handle_buffer_destroy(struct wl_listener *listener, void *data) container_of(listener, struct weston_surface, buffer_destroy_listener); + if (es->buffer && wl_buffer_is_shm(es->buffer)) + update_shm_texture(es); + es->buffer = NULL; }