compositor: call configure on surfaces with a null buffer too
This way the shell can know when a surface has been unmapped by
checking the value returned by weston_surface_is_mapped(surface).
The configure handlers have now width and height parameters, so
they do not need anymore to check manually the buffer size.
If a surface's buffer is NULL the width and height passed to the
configure are both 0.
Configure is now only called after an attach. The variable
weston_surface.pending.newly_attached is set to 1 on attach, and
after the configure call is reset to 0.
diff --git a/tests/weston-test.c b/tests/weston-test.c
index 83a7124..08833e0 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -74,7 +74,7 @@
}
static void
-test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy)
+test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy, int32_t width, int32_t height)
{
struct weston_test_surface *test_surface = surface->private;
struct weston_test *test = test_surface->test;
@@ -85,8 +85,8 @@
surface->geometry.x = test_surface->x;
surface->geometry.y = test_surface->y;
- surface->geometry.width = surface->buffer_ref.buffer->width;
- surface->geometry.height = surface->buffer_ref.buffer->height;
+ surface->geometry.width = width;
+ surface->geometry.height = height;
surface->geometry.dirty = 1;
if (!weston_surface_is_mapped(surface))