From 094c0004a6a42b76303793e9b91d80679275db58 Mon Sep 17 00:00:00 2001 From: jlo62 <122014753+jlo62@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:20:38 +0200 Subject: [PATCH] Update cursor.c --- sway/input/cursor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sway/input/cursor.c b/sway/input/cursor.c index b78719dcc..dbb6b08bc 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -407,6 +407,11 @@ static void handle_pointer_motion_relative( struct wl_listener *listener, void *data) { struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct wlr_pointer_motion_event *e = data; + + struct sway_input_device *sid = input_sway_device_from_wlr(e->device); + struct input_config *ic = sid ? input_device_get_config(sid) : NULL; + float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; + cursor_handle_activity_from_device(cursor, &e->pointer->base); pointer_motion(cursor, e->time_msec, &e->pointer->base, e->delta_x, @@ -418,11 +423,6 @@ static void handle_pointer_motion_absolute( struct sway_cursor *cursor = wl_container_of(listener, cursor, motion_absolute); struct wlr_pointer_motion_absolute_event *event = data; - - struct sway_input_device *sid = input_sway_device_from_wlr(event->device); - struct input_config *ic = sid ? input_device_get_config(sid) : NULL; - float sensitivity = (ic && ic->sensitivity != FLT_MIN) ? ic->sensitivity : 1.0f; - cursor_handle_activity_from_device(cursor, &event->pointer->base); double lx, ly;