input: pass the global touch coordinates to the touch grab
This makes it consistent with the pointer grab, which also gets
global coordinates and not surface relative ones, and allows to
easily filter out gestures based on compositor global hotspots.
Reviewed-by: Daniel Stone <daniels@collabora.com>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index f420384..c1308c5 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1580,7 +1580,7 @@
static void
touch_move_grab_down(struct weston_touch_grab *grab, uint32_t time,
- int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+ int touch_id, wl_fixed_t x, wl_fixed_t y)
{
}
@@ -1602,7 +1602,7 @@
static void
touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time,
- int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+ int touch_id, wl_fixed_t x, wl_fixed_t y)
{
struct weston_touch_move_grab *move = (struct weston_touch_move_grab *) grab;
struct shell_surface *shsurf = move->base.shsurf;
@@ -3291,7 +3291,7 @@
static void
touch_popup_grab_down(struct weston_touch_grab *grab, uint32_t time,
- int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+ int touch_id, wl_fixed_t x, wl_fixed_t y)
{
struct wl_resource *resource;
struct shell_seat *shseat =
@@ -3299,6 +3299,9 @@
struct wl_display *display = shseat->seat->compositor->wl_display;
uint32_t serial;
struct wl_list *resource_list;
+ wl_fixed_t sx, sy;
+
+ weston_view_from_global_fixed(grab->touch->focus, x, y, &sx, &sy);
resource_list = &grab->touch->focus_resource_list;
if (!wl_list_empty(resource_list)) {
@@ -3332,10 +3335,13 @@
static void
touch_popup_grab_motion(struct weston_touch_grab *grab, uint32_t time,
- int touch_id, wl_fixed_t sx, wl_fixed_t sy)
+ int touch_id, wl_fixed_t x, wl_fixed_t y)
{
struct wl_resource *resource;
struct wl_list *resource_list;
+ wl_fixed_t sx, sy;
+
+ weston_view_from_global_fixed(grab->touch->focus, x, y, &sx, &sy);
resource_list = &grab->touch->focus_resource_list;
if (!wl_list_empty(resource_list)) {