From 6f7179c652ba33d95c1dbb37e6a3690f36821743 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 29 Aug 2011 16:09:32 -0400 Subject: [PATCH] compositor: Discard surface.frame if the surface isn't visible --- compositor/compositor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compositor/compositor.c b/compositor/compositor.c index d3e7b09..b068df6 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -253,6 +253,7 @@ wlsc_surface_create(struct wlsc_compositor *compositor, surface->height = height; surface->buffer = NULL; + surface->output = NULL; pixman_region32_init(&surface->damage); pixman_region32_init(&surface->opaque); @@ -1078,9 +1079,16 @@ surface_frame(struct wl_client *client, cb->resource.destroy = destroy_frame_callback; cb->resource.client = client; cb->resource.data = cb; - wl_list_insert(es->output->frame_callback_list.prev, &cb->link); wl_client_add_resource(client, &cb->resource); + + if (es->output) { + wl_list_insert(es->output->frame_callback_list.prev, + &cb->link); + } else { + wl_list_init(&cb->link); + wl_resource_destroy(&cb->resource, 0); + } } const static struct wl_surface_interface surface_interface = { -- 2.7.4