fix: clamp absolute pointer motion to active constraint
This commit is contained in:
parent
4b32697f2b
commit
650ca3ba50
1 changed files with 8 additions and 0 deletions
8
kick.c
8
kick.c
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue