aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c23
1 files changed, 22 insertions, 1 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/**