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.
This commit is contained in:
Giulio Camuffo
2013-02-21 11:29:21 +01:00
committed by Kristian Høgsberg
parent 964a342e53
commit 184df50d3e
5 changed files with 59 additions and 43 deletions
+3 -3
View File
@@ -74,7 +74,7 @@ notify_pointer_position(struct weston_test *test, struct wl_resource *resource)
}
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 @@ test_surface_configure(struct weston_surface *surface, int32_t sx, int32_t sy)
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))