compositor: flush the batched up damage when shm buffer is destroyed
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 20 Jun 2012 13:24:35 +0000 (09:24 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 20 Jun 2012 13:31:13 +0000 (09:31 -0400)
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

index a8ace9c..48b26a5 100644 (file)
@@ -180,12 +180,18 @@ weston_client_launch(struct weston_compositor *compositor,
 }
 
 static void
+update_shm_texture(struct weston_surface *surface);
+
+static void
 surface_handle_buffer_destroy(struct wl_listener *listener, void *data)
 {
        struct weston_surface *es =
                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;
 }