summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-02-28 17:59:33 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-02-28 14:34:53 -0500
commit90fbbd74ccd24e4a9e36303e32ca54c8e1cb87f0 (patch)
tree3badbaa45462e14a94713bd468e6b5e94fe3ec80
parentcacb7cd0f6ba9f60175821c61b41e31f45bcebc5 (diff)
compositor: make the input region of drag surfaces empty
With the input region changes, drag surfaces were being picked and receiving events which led to problems on the client side.
-rw-r--r--src/compositor.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/compositor.c b/src/compositor.c
index a95837e..74c40da 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -190,6 +190,15 @@ region_is_undefined(pixman_region32_t *region)
return region->data == &undef_region_data;
}
+static void
+empty_region(pixman_region32_t *region)
+{
+ if (!region_is_undefined(region))
+ pixman_region32_fini(region);
+
+ pixman_region32_init(region);
+}
+
WL_EXPORT struct weston_surface *
weston_surface_create(struct weston_compositor *compositor)
{
@@ -1910,6 +1919,7 @@ weston_input_update_drag_surface(struct wl_input_device *input_device,
surface_changed = 1;
if (!input_device->drag_surface || surface_changed) {
+ undef_region(&device->drag_surface->input);
device->drag_surface = NULL;
if (!surface_changed)
return;
@@ -1928,8 +1938,14 @@ weston_input_update_drag_surface(struct wl_input_device *input_device,
wl_list_insert(weston_compositor_top(device->compositor),
&device->drag_surface->link);
weston_surface_assign_output(device->drag_surface);
+ empty_region(&device->drag_surface->input);
}
+ /* the client may have attached a buffer with a different size to
+ * the drag surface, causing the input region to be reset */
+ if (region_is_undefined(&device->drag_surface->input))
+ empty_region(&device->drag_surface->input);
+
if (!dx && !dy)
return;