diff options
-rw-r--r-- | sway/input/cursor.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 059f907d..5f2d650e 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -25,7 +25,7 @@ static void cursor_send_pointer_motion(struct sway_cursor *cursor, | |||
25 | swayc_t *swayc = | 25 | swayc_t *swayc = |
26 | swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); | 26 | swayc_at(&root_container, cursor->x, cursor->y, &surface, &sx, &sy); |
27 | if (swayc) { | 27 | if (swayc) { |
28 | wlr_seat_pointer_enter(seat, surface, sx, sy); | 28 | wlr_seat_pointer_notify_enter(seat, surface, sx, sy); |
29 | wlr_seat_pointer_notify_motion(seat, time, sx, sy); | 29 | wlr_seat_pointer_notify_motion(seat, time, sx, sy); |
30 | } else { | 30 | } else { |
31 | wlr_seat_pointer_clear_focus(seat); | 31 | wlr_seat_pointer_clear_focus(seat); |
@@ -57,49 +57,51 @@ static void handle_cursor_button(struct wl_listener *listener, void *data) { | |||
57 | struct sway_cursor *cursor = | 57 | struct sway_cursor *cursor = |
58 | wl_container_of(listener, cursor, button); | 58 | wl_container_of(listener, cursor, button); |
59 | struct wlr_event_pointer_button *event = data; | 59 | struct wlr_event_pointer_button *event = data; |
60 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 60 | wlr_seat_pointer_notify_button(cursor->seat->seat, event->time_msec, |
61 | event->button, event->state); | ||
61 | } | 62 | } |
62 | 63 | ||
63 | static void handle_cursor_axis(struct wl_listener *listener, void *data) { | 64 | static void handle_cursor_axis(struct wl_listener *listener, void *data) { |
64 | struct sway_cursor *cursor = | 65 | struct sway_cursor *cursor = |
65 | wl_container_of(listener, cursor, axis); | 66 | wl_container_of(listener, cursor, axis); |
66 | struct wlr_event_pointer_axis *event = data; | 67 | struct wlr_event_pointer_axis *event = data; |
67 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 68 | wlr_seat_pointer_notify_axis(cursor->seat->seat, event->time_msec, |
69 | event->orientation, event->delta); | ||
68 | } | 70 | } |
69 | 71 | ||
70 | static void handle_touch_down(struct wl_listener *listener, void *data) { | 72 | static void handle_touch_down(struct wl_listener *listener, void *data) { |
71 | struct sway_cursor *cursor = | 73 | struct sway_cursor *cursor = |
72 | wl_container_of(listener, cursor, touch_down); | 74 | wl_container_of(listener, cursor, touch_down); |
73 | struct wlr_event_touch_down *event = data; | 75 | struct wlr_event_touch_down *event = data; |
74 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 76 | sway_log(L_DEBUG, "TODO: handle touch down event: %p", event); |
75 | } | 77 | } |
76 | 78 | ||
77 | static void handle_touch_up(struct wl_listener *listener, void *data) { | 79 | static void handle_touch_up(struct wl_listener *listener, void *data) { |
78 | struct sway_cursor *cursor = | 80 | struct sway_cursor *cursor = |
79 | wl_container_of(listener, cursor, touch_up); | 81 | wl_container_of(listener, cursor, touch_up); |
80 | struct wlr_event_touch_up *event = data; | 82 | struct wlr_event_touch_up *event = data; |
81 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 83 | sway_log(L_DEBUG, "TODO: handle touch up event: %p", event); |
82 | } | 84 | } |
83 | 85 | ||
84 | static void handle_touch_motion(struct wl_listener *listener, void *data) { | 86 | static void handle_touch_motion(struct wl_listener *listener, void *data) { |
85 | struct sway_cursor *cursor = | 87 | struct sway_cursor *cursor = |
86 | wl_container_of(listener, cursor, touch_motion); | 88 | wl_container_of(listener, cursor, touch_motion); |
87 | struct wlr_event_touch_motion *event = data; | 89 | struct wlr_event_touch_motion *event = data; |
88 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 90 | sway_log(L_DEBUG, "TODO: handle touch motion event: %p", event); |
89 | } | 91 | } |
90 | 92 | ||
91 | static void handle_tool_axis(struct wl_listener *listener, void *data) { | 93 | static void handle_tool_axis(struct wl_listener *listener, void *data) { |
92 | struct sway_cursor *cursor = | 94 | struct sway_cursor *cursor = |
93 | wl_container_of(listener, cursor, tool_axis); | 95 | wl_container_of(listener, cursor, tool_axis); |
94 | struct wlr_event_tablet_tool_axis *event = data; | 96 | struct wlr_event_tablet_tool_axis *event = data; |
95 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 97 | sway_log(L_DEBUG, "TODO: handle tool axis event: %p", event); |
96 | } | 98 | } |
97 | 99 | ||
98 | static void handle_tool_tip(struct wl_listener *listener, void *data) { | 100 | static void handle_tool_tip(struct wl_listener *listener, void *data) { |
99 | struct sway_cursor *cursor = | 101 | struct sway_cursor *cursor = |
100 | wl_container_of(listener, cursor, tool_tip); | 102 | wl_container_of(listener, cursor, tool_tip); |
101 | struct wlr_event_tablet_tool_tip *event = data; | 103 | struct wlr_event_tablet_tool_tip *event = data; |
102 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 104 | sway_log(L_DEBUG, "TODO: handle tool tip event: %p", event); |
103 | } | 105 | } |
104 | 106 | ||
105 | static void handle_request_set_cursor(struct wl_listener *listener, | 107 | static void handle_request_set_cursor(struct wl_listener *listener, |
@@ -107,7 +109,7 @@ static void handle_request_set_cursor(struct wl_listener *listener, | |||
107 | struct sway_cursor *cursor = | 109 | struct sway_cursor *cursor = |
108 | wl_container_of(listener, cursor, request_set_cursor); | 110 | wl_container_of(listener, cursor, request_set_cursor); |
109 | struct wlr_seat_pointer_request_set_cursor_event *event = data; | 111 | struct wlr_seat_pointer_request_set_cursor_event *event = data; |
110 | sway_log(L_DEBUG, "TODO: handle event: %p", event); | 112 | sway_log(L_DEBUG, "TODO: handle request set cursor event: %p", event); |
111 | } | 113 | } |
112 | 114 | ||
113 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { | 115 | struct sway_cursor *sway_cursor_create(struct sway_seat *seat) { |