aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/cursor.c23
-rw-r--r--sway/input/seat.c6
2 files changed, 24 insertions, 5 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 4b2d99e6..c84d6c40 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -831,6 +831,12 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
transaction_commit_dirty();
}
+static void handle_cursor_frame(struct wl_listener *listener, void *data) {
+ struct sway_cursor *cursor = wl_container_of(listener, cursor, frame);
+ cursor_handle_activity(cursor);
+ wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
+}
+
static void handle_touch_down(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down);
wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat);
@@ -1073,6 +1079,19 @@ void sway_cursor_destroy(struct sway_cursor *cursor) {
wl_event_source_remove(cursor->hide_source);
+ wl_list_remove(&cursor->motion.link);
+ wl_list_remove(&cursor->motion_absolute.link);
+ wl_list_remove(&cursor->button.link);
+ wl_list_remove(&cursor->axis.link);
+ wl_list_remove(&cursor->frame.link);
+ wl_list_remove(&cursor->touch_down.link);
+ wl_list_remove(&cursor->touch_up.link);
+ wl_list_remove(&cursor->touch_motion.link);
+ wl_list_remove(&cursor->tool_axis.link);
+ wl_list_remove(&cursor->tool_tip.link);
+ wl_list_remove(&cursor->tool_button.link);
+ wl_list_remove(&cursor->request_set_cursor.link);
+
wlr_xcursor_manager_destroy(cursor->xcursor_manager);
wlr_cursor_destroy(cursor->cursor);
free(cursor);
@@ -1113,6 +1132,9 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
wl_signal_add(&wlr_cursor->events.axis, &cursor->axis);
cursor->axis.notify = handle_cursor_axis;
+ wl_signal_add(&wlr_cursor->events.frame, &cursor->frame);
+ cursor->frame.notify = handle_cursor_frame;
+
wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down);
cursor->touch_down.notify = handle_touch_down;
@@ -1143,7 +1165,6 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
cursor->cursor = wlr_cursor;
return cursor;
-
}
/**
diff --git a/sway/input/seat.c b/sway/input/seat.c
index f216810b..8cb1d8e9 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1,7 +1,6 @@
#define _POSIX_C_SOURCE 200809L
-#include <assert.h>
-#include <errno.h>
#include <linux/input-event-codes.h>
+#include <string.h>
#include <strings.h>
#include <time.h>
#include <wlr/types/wlr_cursor.h>
@@ -839,8 +838,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
wl_event_source_timer_update(view->urgent_timer,
config->urgent_timeout);
} else {
- sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)",
- strerror(errno));
+ sway_log_errno(SWAY_ERROR, "Unable to create urgency timer");
handle_urgent_timeout(view);
}
} else {