]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: don't synthesize relative motion events from absolute events
authorJohn Lindgren <john@jlindgren.net>
Sat, 6 Dec 2025 17:49:09 +0000 (12:49 -0500)
committerJohn Lindgren <john@jlindgren.net>
Sun, 7 Dec 2025 06:35:22 +0000 (01:35 -0500)
It seems to have been inherited behavior from tinywl, but it's not clear
what purpose it serves, and it causes a couple of issues:

- A new absolute position that's discontinuous with the previous cursor
  position can produce unexpectedly large relative motion deltas. This
  can occur for example when multiple input devices are active, or in
  nested/VM scenarios when the pointer leaves the windowed output and
  re-enters at a different point.

- When the cursor position is locked via constraint, the computed deltas
  continue to get larger as the absolute event position diverges further
  from the locked position. This led to the mouse pointer going crazy in
  applications that use the relative events, such as games under Wine/
  Wayland.

src/input/cursor.c

index 86297c9a664f2cea734bb0db7680e8cb8fd2d339..29409bea73227c21c02e228a7b9ade60a7d7f86c 100644 (file)
@@ -985,11 +985,6 @@ handle_motion_absolute(struct wl_listener *listener, void *data)
        double dx = lx - seat->cursor->x;
        double dy = ly - seat->cursor->y;
 
-       wlr_relative_pointer_manager_v1_send_relative_motion(
-               seat->server->relative_pointer_manager,
-               seat->seat, (uint64_t)event->time_msec * 1000,
-               dx, dy, dx, dy);
-
        preprocess_cursor_motion(seat, event->pointer,
                event->time_msec, dx, dy);
 }