summaryrefslogtreecommitdiff
path: root/desktop-shell
diff options
context:
space:
mode:
authorGiulio Camuffo <giuliocamuffo@gmail.com>2015-07-08 11:55:28 +0300
committerDaniel Stone <daniels@collabora.com>2015-08-06 16:21:01 +0100
commit61ed7b6bf06895b6e0ac8e3c5fff12e491449fd9 (patch)
treed8f6e0861a0ca847edd51452d6f493821eddc729 /desktop-shell
parent7239d74bb3d43c46c958079e7c8f759371599455 (diff)
downloadweston-61ed7b6bf06895b6e0ac8e3c5fff12e491449fd9.tar.gz
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>
Diffstat (limited to 'desktop-shell')
-rw-r--r--desktop-shell/shell.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index f420384f..c1308c52 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1580,7 +1580,7 @@ bind_workspace_manager(struct wl_client *client,
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 @@ touch_move_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id)
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 const struct weston_pointer_grab_interface popup_grab_interface = {
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 @@ touch_popup_grab_down(struct weston_touch_grab *grab, uint32_t time,
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 @@ touch_popup_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id)
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)) {