mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-27 03:36:31 +00:00
fix virtual pointers
When motionabsolute() is called from warpd, event->time_msec is 0, so motionnotify() doesn't call wlr_cursor_move(). Fix this by explicitly warping the cursor in this case, like it was done before implementing pointer constraints. I don't know if this is a bug in warpd or time_msec is always 0 with virtual pointers, since the only other software that uses the virtual pointer protocol I know of is wl-kbptr, and I can't get that to work with dwl at all.
This commit is contained in:
parent
ea33ce9ae6
commit
2b171fd501
1 changed files with 3 additions and 0 deletions
3
dwl.c
3
dwl.c
|
@ -1675,6 +1675,9 @@ motionabsolute(struct wl_listener *listener, void *data)
|
||||||
struct wlr_pointer_motion_absolute_event *event = data;
|
struct wlr_pointer_motion_absolute_event *event = data;
|
||||||
double lx, ly, dx, dy;
|
double lx, ly, dx, dy;
|
||||||
|
|
||||||
|
if (!event->time_msec) /* this is 0 with virtual pointers */
|
||||||
|
wlr_cursor_warp_absolute(cursor, &event->pointer->base, event->x, event->y);
|
||||||
|
|
||||||
wlr_cursor_absolute_to_layout_coords(cursor, &event->pointer->base, event->x, event->y, &lx, &ly);
|
wlr_cursor_absolute_to_layout_coords(cursor, &event->pointer->base, event->x, event->y, &lx, &ly);
|
||||||
dx = lx - cursor->x;
|
dx = lx - cursor->x;
|
||||||
dy = ly - cursor->y;
|
dy = ly - cursor->y;
|
||||||
|
|
Loading…
Reference in a new issue