fix: clamp absolute pointer motion to active constraint

This commit is contained in:
Andrew Hamilton 2026-09-11 07:57:18 +10:00
parent 4b32697f2b
commit 650ca3ba50

8
kick.c
View file

@ -9806,6 +9806,14 @@ static void native_ptr_abs(uint32_t time, struct wlr_input_device *dev,
double x, double y) {
if (!server.cursor) return;
wlr_cursor_warp_absolute(server.cursor, dev, x, y);
/* Same clamp as the relative path: an absolute tablet (or a virtual
pointer) must not escape a lock/confinement the game requested. */
if (server.active_constraint) {
double cx = server.cursor->x, cy = server.cursor->y;
constraint_filter_abs(&cx, &cy);
if (cx != server.cursor->x || cy != server.cursor->y)
wlr_cursor_warp(server.cursor, NULL, cx, cy);
}
standalone_forward_pointer(time);
}