summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-02-19 22:15:21 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-02-19 22:15:21 -0500
commitd0e2ef7779b0fc70f13a8c2191758f5822bc320a (patch)
treef91a461b1a04f0da4f6b1d56a203333b590a4742
parent0704539ec4d81256b95b5b89129d8740f86cb8e3 (diff)
compositor: Surface is unmapped when surface->output is NULL
surface->buffer can be NULL, which happens when a client destroys the attached buffer. Fixes list corruption on resize.
-rw-r--r--src/compositor.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 2992ee6..8339e6c 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1114,7 +1114,7 @@ surface_attach(struct wl_client *client,
{
struct weston_surface *es = resource->data;
struct weston_shell *shell = es->compositor->shell;
- struct wl_buffer *buffer, *prev;
+ struct wl_buffer *buffer;
if (!buffer_resource && !es->output)
return;
@@ -1134,12 +1134,11 @@ surface_attach(struct wl_client *client,
buffer = buffer_resource->data;
buffer->busy_count++;
- prev = es->buffer;
es->buffer = buffer;
wl_list_insert(es->buffer->resource.destroy_listener_list.prev,
&es->buffer_destroy_listener.link);
- if (prev == NULL) {
+ if (es->output == NULL) {
shell->map(shell, es, buffer->width, buffer->height, sx, sy);
} else if (sx != 0 || sy != 0 ||
es->geometry.width != buffer->width ||