summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-08-26 17:13:27 -0500
committerBryce Harrington <bryce@osg.samsung.com>2015-10-23 12:46:05 -0700
commit46812b6e71e43c8593969d609111e4935f7d6c4e (patch)
tree0fcfd770aca39b3059b854aaf254dd3196565717 /clients
parent5d13548c7e0da6bbd9a5ee2edc1b94f6b36133ec (diff)
downloadweston-46812b6e71e43c8593969d609111e4935f7d6c4e.tar.gz
clients: don't discard motion if we have a grab
We discard motion outside the window on the assumption it's from before some event that caused the window to shrink. However, if we have a grab it's likely that this motion is actually from dragging from the inside of the window out. This fixes a problem where drag selecting in weston terminal behaves oddly - it doesn't update the select region while the drag is happening outside the window. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Tested-by: Luis de Bethencourt <luisbg@osg.samsung.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'clients')
-rw-r--r--clients/window.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/clients/window.c b/clients/window.c
index 6941201e..47628deb 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2746,12 +2746,13 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
/* when making the window smaller - e.g. after a unmaximise we might
* still have a pending motion event that the compositor has picked
- * based on the old surface dimensions
+ * based on the old surface dimensions. However, if we have an active
+ * grab, we expect to see input from outside the window anyway.
*/
- if (sx < window->main_surface->allocation.x ||
+ if (!input->grab && (sx < window->main_surface->allocation.x ||
sy < window->main_surface->allocation.y ||
sx > window->main_surface->allocation.width ||
- sy > window->main_surface->allocation.height)
+ sy > window->main_surface->allocation.height))
return;
if (!(input->grab && input->grab_button)) {