]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input: warp cursor to touch coordinates
authorJens Peters <jp7677@gmail.com>
Sun, 27 Oct 2024 08:07:54 +0000 (09:07 +0100)
committerHiroaki Yamamoto <hrak1529@gmail.com>
Sun, 10 Nov 2024 08:08:38 +0000 (17:08 +0900)
This makes the behavior consistent with non-touch
capable surfaces and the desktop.

src/input/touch.c

index 8557d9c7bead8a0302f97d4315a6ec6ab65911d7..e7c9a26e5bdc22cdf5070d46f2ef56238ea44003 100644 (file)
@@ -77,6 +77,8 @@ handle_touch_motion(struct wl_listener *listener, void *data)
                                double sx = lx - touch_point->x_offset;
                                double sy = ly - touch_point->y_offset;
 
+                               wlr_cursor_warp_absolute(seat->cursor,
+                                       &event->touch->base, event->x, event->y);
                                wlr_seat_touch_notify_motion(seat->seat, event->time_msec,
                                        event->touch_id, sx, sy);
                        } else {
@@ -133,6 +135,8 @@ handle_touch_down(struct wl_listener *listener, void *data)
                        }
                }
 
+               wlr_cursor_warp_absolute(seat->cursor,
+                       &event->touch->base, event->x, event->y);
                wlr_seat_touch_notify_down(seat->seat, touch_point->surface,
                        event->time_msec, event->touch_id, sx, sy);
        } else {