aboutsummaryrefslogtreecommitdiffstats
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) {
831 transaction_commit_dirty(); 831 transaction_commit_dirty();
832} 832}
833 833
834static void handle_cursor_frame(struct wl_listener *listener, void *data) {
835 struct sway_cursor *cursor = wl_container_of(listener, cursor, frame);
836 cursor_handle_activity(cursor);
837 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
838}
839
834static void handle_touch_down(struct wl_listener *listener, void *data) { 840static void handle_touch_down(struct wl_listener *listener, void *data) {
835 struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down); 841 struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down);
836 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat); 842 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat);
@@ -1073,6 +1079,19 @@ void sway_cursor_destroy(struct sway_cursor *cursor) {
1073 1079
1074 wl_event_source_remove(cursor->hide_source); 1080 wl_event_source_remove(cursor->hide_source);
1075 1081
1082 wl_list_remove(&cursor->motion.link);
1083 wl_list_remove(&cursor->motion_absolute.link);
1084 wl_list_remove(&cursor->button.link);
1085 wl_list_remove(&cursor->axis.link);
1086 wl_list_remove(&cursor->frame.link);
1087 wl_list_remove(&cursor->touch_down.link);
1088 wl_list_remove(&cursor->touch_up.link);
1089 wl_list_remove(&cursor->touch_motion.link);
1090 wl_list_remove(&cursor->tool_axis.link);
1091 wl_list_remove(&cursor->tool_tip.link);
1092 wl_list_remove(&cursor->tool_button.link);
1093 wl_list_remove(&cursor->request_set_cursor.link);
1094
1076 wlr_xcursor_manager_destroy(cursor->xcursor_manager); 1095 wlr_xcursor_manager_destroy(cursor->xcursor_manager);
1077 wlr_cursor_destroy(cursor->cursor); 1096 wlr_cursor_destroy(cursor->cursor);
1078 free(cursor); 1097 free(cursor);
@@ -1113,6 +1132,9 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1113 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis); 1132 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis);
1114 cursor->axis.notify = handle_cursor_axis; 1133 cursor->axis.notify = handle_cursor_axis;
1115 1134
1135 wl_signal_add(&wlr_cursor->events.frame, &cursor->frame);
1136 cursor->frame.notify = handle_cursor_frame;
1137
1116 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down); 1138 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down);
1117 cursor->touch_down.notify = handle_touch_down; 1139 cursor->touch_down.notify = handle_touch_down;
1118 1140
@@ -1143,7 +1165,6 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1143 cursor->cursor = wlr_cursor; 1165 cursor->cursor = wlr_cursor;
1144 1166
1145 return cursor; 1167 return cursor;
1146
1147} 1168}
1148 1169
1149/** 1170/**
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 @@
1#define _POSIX_C_SOURCE 200809L 1#define _POSIX_C_SOURCE 200809L
2#include <assert.h>
3#include <errno.h>
4#include <linux/input-event-codes.h> 2#include <linux/input-event-codes.h>
3#include <string.h>
5#include <strings.h> 4#include <strings.h>
6#include <time.h> 5#include <time.h>
7#include <wlr/types/wlr_cursor.h> 6#include <wlr/types/wlr_cursor.h>
@@ -839,8 +838,7 @@ void seat_set_focus(struct sway_seat *seat, struct sway_node *node) {
839 wl_event_source_timer_update(view->urgent_timer, 838 wl_event_source_timer_update(view->urgent_timer,
840 config->urgent_timeout); 839 config->urgent_timeout);
841 } else { 840 } else {
842 sway_log(SWAY_ERROR, "Unable to create urgency timer (%s)", 841 sway_log_errno(SWAY_ERROR, "Unable to create urgency timer");
843 strerror(errno));
844 handle_urgent_timeout(view); 842 handle_urgent_timeout(view);
845 } 843 }
846 } else { 844 } else {