summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2019-01-27 11:44:09 -0500
committerLibravatar GitHub <noreply@github.com>2019-01-27 11:44:09 -0500
commit897250c65fb4d7123361dc6f77c2824179ed8885 (patch)
tree3018c4f13aa4826a905161f741602b90c446aa3e
parentRemove unnecessary underscores in man pages (diff)
parentUpdate for swaywm/wlroots#1503 (diff)
downloadsway-897250c65fb4d7123361dc6f77c2824179ed8885.tar.gz
sway-897250c65fb4d7123361dc6f77c2824179ed8885.tar.zst
sway-897250c65fb4d7123361dc6f77c2824179ed8885.zip
Merge pull request #3519 from emersion/pointer-frame
Update for swaywm/wlroots#1503
-rw-r--r--include/sway/input/cursor.h1
-rw-r--r--sway/input/cursor.c23
2 files changed, 23 insertions, 1 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index abd72783..c87d8332 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -30,6 +30,7 @@ struct sway_cursor {
30 struct wl_listener motion_absolute; 30 struct wl_listener motion_absolute;
31 struct wl_listener button; 31 struct wl_listener button;
32 struct wl_listener axis; 32 struct wl_listener axis;
33 struct wl_listener frame;
33 34
34 struct wl_listener touch_down; 35 struct wl_listener touch_down;
35 struct wl_listener touch_up; 36 struct wl_listener touch_up;
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index bf9bf2da..af2799ce 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -821,6 +821,12 @@ static void handle_cursor_axis(struct wl_listener *listener, void *data) {
821 transaction_commit_dirty(); 821 transaction_commit_dirty();
822} 822}
823 823
824static void handle_cursor_frame(struct wl_listener *listener, void *data) {
825 struct sway_cursor *cursor = wl_container_of(listener, cursor, frame);
826 cursor_handle_activity(cursor);
827 wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
828}
829
824static void handle_touch_down(struct wl_listener *listener, void *data) { 830static void handle_touch_down(struct wl_listener *listener, void *data) {
825 struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down); 831 struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down);
826 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat); 832 wlr_idle_notify_activity(server.idle, cursor->seat->wlr_seat);
@@ -1063,6 +1069,19 @@ void sway_cursor_destroy(struct sway_cursor *cursor) {
1063 1069
1064 wl_event_source_remove(cursor->hide_source); 1070 wl_event_source_remove(cursor->hide_source);
1065 1071
1072 wl_list_remove(&cursor->motion.link);
1073 wl_list_remove(&cursor->motion_absolute.link);
1074 wl_list_remove(&cursor->button.link);
1075 wl_list_remove(&cursor->axis.link);
1076 wl_list_remove(&cursor->frame.link);
1077 wl_list_remove(&cursor->touch_down.link);
1078 wl_list_remove(&cursor->touch_up.link);
1079 wl_list_remove(&cursor->touch_motion.link);
1080 wl_list_remove(&cursor->tool_axis.link);
1081 wl_list_remove(&cursor->tool_tip.link);
1082 wl_list_remove(&cursor->tool_button.link);
1083 wl_list_remove(&cursor->request_set_cursor.link);
1084
1066 wlr_xcursor_manager_destroy(cursor->xcursor_manager); 1085 wlr_xcursor_manager_destroy(cursor->xcursor_manager);
1067 wlr_cursor_destroy(cursor->cursor); 1086 wlr_cursor_destroy(cursor->cursor);
1068 free(cursor); 1087 free(cursor);
@@ -1103,6 +1122,9 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1103 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis); 1122 wl_signal_add(&wlr_cursor->events.axis, &cursor->axis);
1104 cursor->axis.notify = handle_cursor_axis; 1123 cursor->axis.notify = handle_cursor_axis;
1105 1124
1125 wl_signal_add(&wlr_cursor->events.frame, &cursor->frame);
1126 cursor->frame.notify = handle_cursor_frame;
1127
1106 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down); 1128 wl_signal_add(&wlr_cursor->events.touch_down, &cursor->touch_down);
1107 cursor->touch_down.notify = handle_touch_down; 1129 cursor->touch_down.notify = handle_touch_down;
1108 1130
@@ -1133,7 +1155,6 @@ struct sway_cursor *sway_cursor_create(struct sway_seat *seat) {
1133 cursor->cursor = wlr_cursor; 1155 cursor->cursor = wlr_cursor;
1134 1156
1135 return cursor; 1157 return cursor;
1136
1137} 1158}
1138 1159
1139/** 1160/**