compositor, clients: double-buffer input region

Make input region double-buffered as specified in the new protocol.

While doing it, get rid of the undef region code, and instead use a
maximum sized real pixman region. This avoids special-casing regions
that might sometimes be undef.

As the input region is now usable by default instead of undef,
weston_surface_update_transform() does not need to reset the input
region anymore.

weston_surface_attach() no longer resets the input region on surface
size change. Therefore, also weston_seat_update_drag_surface() does not
need to reset it.

Update toytoolkit to set input region before calling wl_surface_commit()
or swapBuffers (which does commit).

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
Pekka Paalanen
2012-10-10 12:49:28 +03:00
committed by Kristian Høgsberg
parent 512dde8ce9
commit 0cbd3b5059
3 changed files with 41 additions and 58 deletions
+7 -7
View File
@@ -837,6 +837,13 @@ window_attach_surface(struct window *window)
window->opaque_region = NULL;
}
if (window->input_region) {
wl_surface_set_input_region(window->surface,
window->input_region);
wl_region_destroy(window->input_region);
window->input_region = NULL;
}
switch (window->buffer_type) {
#ifdef HAVE_CAIRO_EGL
case WINDOW_BUFFER_TYPE_EGL_WINDOW:
@@ -867,13 +874,6 @@ window_attach_surface(struct window *window)
default:
return;
}
if (window->input_region) {
wl_surface_set_input_region(window->surface,
window->input_region);
wl_region_destroy(window->input_region);
window->input_region = NULL;
}
}
int