diff options
-rw-r--r-- | sway/input/cursor.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 08222494..731e82ad 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -275,6 +275,7 @@ static int hide_notify(void *data) { | |||
275 | struct sway_cursor *cursor = data; | 275 | struct sway_cursor *cursor = data; |
276 | wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0); | 276 | wlr_cursor_set_image(cursor->cursor, NULL, 0, 0, 0, 0, 0, 0); |
277 | cursor->hidden = true; | 277 | cursor->hidden = true; |
278 | wlr_seat_pointer_clear_focus(cursor->seat->wlr_seat); | ||
278 | return 1; | 279 | return 1; |
279 | } | 280 | } |
280 | 281 | ||
@@ -313,6 +314,7 @@ void cursor_unhide(struct sway_cursor *cursor) { | |||
313 | cursor->image = NULL; | 314 | cursor->image = NULL; |
314 | cursor_set_image(cursor, image, cursor->image_client); | 315 | cursor_set_image(cursor, image, cursor->image_client); |
315 | } | 316 | } |
317 | cursor_rebase(cursor); | ||
316 | } | 318 | } |
317 | 319 | ||
318 | void cursor_send_pointer_motion(struct sway_cursor *cursor, | 320 | void cursor_send_pointer_motion(struct sway_cursor *cursor, |
@@ -388,10 +390,10 @@ void cursor_send_pointer_motion(struct sway_cursor *cursor, | |||
388 | static void handle_cursor_motion(struct wl_listener *listener, void *data) { | 390 | static void handle_cursor_motion(struct wl_listener *listener, void *data) { |
389 | struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); | 391 | struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); |
390 | struct wlr_event_pointer_motion *event = data; | 392 | struct wlr_event_pointer_motion *event = data; |
393 | cursor_handle_activity(cursor); | ||
391 | wlr_cursor_move(cursor->cursor, event->device, | 394 | wlr_cursor_move(cursor->cursor, event->device, |
392 | event->delta_x, event->delta_y); | 395 | event->delta_x, event->delta_y); |
393 | cursor_send_pointer_motion(cursor, event->time_msec); | 396 | cursor_send_pointer_motion(cursor, event->time_msec); |
394 | cursor_handle_activity(cursor); | ||
395 | transaction_commit_dirty(); | 397 | transaction_commit_dirty(); |
396 | } | 398 | } |
397 | 399 | ||
@@ -400,9 +402,9 @@ static void handle_cursor_motion_absolute( | |||
400 | struct sway_cursor *cursor = | 402 | struct sway_cursor *cursor = |
401 | wl_container_of(listener, cursor, motion_absolute); | 403 | wl_container_of(listener, cursor, motion_absolute); |
402 | struct wlr_event_pointer_motion_absolute *event = data; | 404 | struct wlr_event_pointer_motion_absolute *event = data; |
405 | cursor_handle_activity(cursor); | ||
403 | wlr_cursor_warp_absolute(cursor->cursor, event->device, event->x, event->y); | 406 | wlr_cursor_warp_absolute(cursor->cursor, event->device, event->x, event->y); |
404 | cursor_send_pointer_motion(cursor, event->time_msec); | 407 | cursor_send_pointer_motion(cursor, event->time_msec); |
405 | cursor_handle_activity(cursor); | ||
406 | transaction_commit_dirty(); | 408 | transaction_commit_dirty(); |
407 | } | 409 | } |
408 | 410 | ||
@@ -698,9 +700,9 @@ void dispatch_cursor_button(struct sway_cursor *cursor, | |||
698 | static void handle_cursor_button(struct wl_listener *listener, void *data) { | 700 | static void handle_cursor_button(struct wl_listener *listener, void *data) { |
699 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); | 701 | struct sway_cursor *cursor = wl_container_of(listener, cursor, button); |
700 | struct wlr_event_pointer_button *event = data; | 702 | struct wlr_event_pointer_button *event = data; |
703 | cursor_handle_activity(cursor); | ||
701 | dispatch_cursor_button(cursor, event->device, | 704 | dispatch_cursor_button(cursor, event->device, |
702 | event->time_msec, event->button, event->state); | 705 | event->time_msec, event->button, event->state); |
703 | cursor_handle_activity(cursor); | ||
704 | transaction_commit_dirty(); | 706 | transaction_commit_dirty(); |
705 | } | 707 | } |
706 | 708 | ||
@@ -814,8 +816,8 @@ void dispatch_cursor_axis(struct sway_cursor *cursor, | |||
814 | static void handle_cursor_axis(struct wl_listener *listener, void *data) { | 816 | static void handle_cursor_axis(struct wl_listener *listener, void *data) { |
815 | struct sway_cursor *cursor = wl_container_of(listener, cursor, axis); | 817 | struct sway_cursor *cursor = wl_container_of(listener, cursor, axis); |
816 | struct wlr_event_pointer_axis *event = data; | 818 | struct wlr_event_pointer_axis *event = data; |
817 | dispatch_cursor_axis(cursor, event); | ||
818 | cursor_handle_activity(cursor); | 819 | cursor_handle_activity(cursor); |
820 | dispatch_cursor_axis(cursor, event); | ||
819 | transaction_commit_dirty(); | 821 | transaction_commit_dirty(); |
820 | } | 822 | } |
821 | 823 | ||