input: let the pointer motion handlers move the pointer
this allows to implement pointer barriers by using a custom handler
diff --git a/src/shell.c b/src/shell.c
index cbb741a..fe332e1 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1217,13 +1217,17 @@
}
static void
-move_grab_motion(struct weston_pointer_grab *grab, uint32_t time)
+move_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
+ wl_fixed_t x, wl_fixed_t y)
{
struct weston_move_grab *move = (struct weston_move_grab *) grab;
struct weston_pointer *pointer = grab->pointer;
struct shell_surface *shsurf = move->base.shsurf;
- int dx = wl_fixed_to_int(pointer->x + move->dx);
- int dy = wl_fixed_to_int(pointer->y + move->dy);
+ int dx, dy;
+
+ weston_pointer_move(pointer, x, y);
+ dx = wl_fixed_to_int(pointer->x + move->dx);
+ dy = wl_fixed_to_int(pointer->y + move->dy);
if (!shsurf)
return;
@@ -1327,7 +1331,8 @@
};
static void
-resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time)
+resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
+ wl_fixed_t x, wl_fixed_t y)
{
struct weston_resize_grab *resize = (struct weston_resize_grab *) grab;
struct weston_pointer *pointer = grab->pointer;
@@ -1336,6 +1341,8 @@
wl_fixed_t from_x, from_y;
wl_fixed_t to_x, to_y;
+ weston_pointer_move(pointer, x, y);
+
if (!shsurf)
return;
@@ -1513,8 +1520,10 @@
}
static void
-busy_cursor_grab_motion(struct weston_pointer_grab *grab, uint32_t time)
+busy_cursor_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
+ wl_fixed_t x, wl_fixed_t y)
{
+ weston_pointer_move(grab->pointer, x, y);
}
static void
@@ -2270,12 +2279,15 @@
}
static void
-popup_grab_motion(struct weston_pointer_grab *grab, uint32_t time)
+popup_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
+ wl_fixed_t x, wl_fixed_t y)
{
struct weston_pointer *pointer = grab->pointer;
struct wl_resource *resource;
wl_fixed_t sx, sy;
+ weston_pointer_move(pointer, x, y);
+
wl_resource_for_each(resource, &pointer->focus_resource_list) {
weston_view_from_global_fixed(pointer->focus,
pointer->x, pointer->y,
@@ -3086,7 +3098,8 @@
}
static void
-rotate_grab_motion(struct weston_pointer_grab *grab, uint32_t time)
+rotate_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
+ wl_fixed_t x, wl_fixed_t y)
{
struct rotate_grab *rotate =
container_of(grab, struct rotate_grab, base.grab);
@@ -3094,6 +3107,8 @@
struct shell_surface *shsurf = rotate->base.shsurf;
float cx, cy, dx, dy, cposx, cposy, dposx, dposy, r;
+ weston_pointer_move(pointer, x, y);
+
if (!shsurf)
return;