Skip to content

Commit 2b171fd

Browse files
committed
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.
1 parent ea33ce9 commit 2b171fd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dwl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,9 @@ motionabsolute(struct wl_listener *listener, void *data)
16751675
struct wlr_pointer_motion_absolute_event *event = data;
16761676
double lx, ly, dx, dy;
16771677

1678+
if (!event->time_msec) /* this is 0 with virtual pointers */
1679+
wlr_cursor_warp_absolute(cursor, &event->pointer->base, event->x, event->y);
1680+
16781681
wlr_cursor_absolute_to_layout_coords(cursor, &event->pointer->base, event->x, event->y, &lx, &ly);
16791682
dx = lx - cursor->x;
16801683
dy = ly - cursor->y;

0 commit comments

Comments
 (0)