aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/seat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/input/seat.h')
-rw-r--r--include/sway/input/seat.h114
1 files changed, 82 insertions, 32 deletions
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 4118df66..e5aa8478 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -3,7 +3,9 @@
3 3
4#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> 4#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
5#include <wlr/types/wlr_layer_shell_v1.h> 5#include <wlr/types/wlr_layer_shell_v1.h>
6#include <wlr/types/wlr_scene.h>
6#include <wlr/types/wlr_seat.h> 7#include <wlr/types/wlr_seat.h>
8#include <wlr/types/wlr_touch.h>
7#include <wlr/util/edges.h> 9#include <wlr/util/edges.h>
8#include "sway/config.h" 10#include "sway/config.h"
9#include "sway/input/input-manager.h" 11#include "sway/input/input-manager.h"
@@ -18,16 +20,38 @@ struct sway_seatop_impl {
18 enum wlr_button_state state); 20 enum wlr_button_state state);
19 void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec); 21 void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec);
20 void (*pointer_axis)(struct sway_seat *seat, 22 void (*pointer_axis)(struct sway_seat *seat,
21 struct wlr_event_pointer_axis *event); 23 struct wlr_pointer_axis_event *event);
24 void (*hold_begin)(struct sway_seat *seat,
25 struct wlr_pointer_hold_begin_event *event);
26 void (*hold_end)(struct sway_seat *seat,
27 struct wlr_pointer_hold_end_event *event);
28 void (*pinch_begin)(struct sway_seat *seat,
29 struct wlr_pointer_pinch_begin_event *event);
30 void (*pinch_update)(struct sway_seat *seat,
31 struct wlr_pointer_pinch_update_event *event);
32 void (*pinch_end)(struct sway_seat *seat,
33 struct wlr_pointer_pinch_end_event *event);
34 void (*swipe_begin)(struct sway_seat *seat,
35 struct wlr_pointer_swipe_begin_event *event);
36 void (*swipe_update)(struct sway_seat *seat,
37 struct wlr_pointer_swipe_update_event *event);
38 void (*swipe_end)(struct sway_seat *seat,
39 struct wlr_pointer_swipe_end_event *event);
22 void (*rebase)(struct sway_seat *seat, uint32_t time_msec); 40 void (*rebase)(struct sway_seat *seat, uint32_t time_msec);
41 void (*touch_motion)(struct sway_seat *seat,
42 struct wlr_touch_motion_event *event, double lx, double ly);
43 void (*touch_up)(struct sway_seat *seat,
44 struct wlr_touch_up_event *event);
45 void (*touch_down)(struct sway_seat *seat,
46 struct wlr_touch_down_event *event, double lx, double ly);
47 void (*touch_cancel)(struct sway_seat *seat,
48 struct wlr_touch_cancel_event *event);
23 void (*tablet_tool_motion)(struct sway_seat *seat, 49 void (*tablet_tool_motion)(struct sway_seat *seat,
24 struct sway_tablet_tool *tool, uint32_t time_msec); 50 struct sway_tablet_tool *tool, uint32_t time_msec);
25 void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool, 51 void (*tablet_tool_tip)(struct sway_seat *seat, struct sway_tablet_tool *tool,
26 uint32_t time_msec, enum wlr_tablet_tool_tip_state state); 52 uint32_t time_msec, enum wlr_tablet_tool_tip_state state);
27 void (*end)(struct sway_seat *seat); 53 void (*end)(struct sway_seat *seat);
28 void (*unref)(struct sway_seat *seat, struct sway_container *con); 54 void (*unref)(struct sway_seat *seat, struct sway_container *con);
29 void (*render)(struct sway_seat *seat, struct sway_output *output,
30 pixman_region32_t *damage);
31 bool allow_set_cursor; 55 bool allow_set_cursor;
32}; 56};
33 57
@@ -50,19 +74,6 @@ struct sway_seat_node {
50 struct wl_listener destroy; 74 struct wl_listener destroy;
51}; 75};
52 76
53struct sway_drag_icon {
54 struct sway_seat *seat;
55 struct wlr_drag_icon *wlr_drag_icon;
56 struct wl_list link; // sway_root::drag_icons
57
58 double x, y; // in layout-local coordinates
59
60 struct wl_listener surface_commit;
61 struct wl_listener map;
62 struct wl_listener unmap;
63 struct wl_listener destroy;
64};
65
66struct sway_drag { 77struct sway_drag {
67 struct sway_seat *seat; 78 struct sway_seat *seat;
68 struct wlr_drag *wlr_drag; 79 struct wlr_drag *wlr_drag;
@@ -73,16 +84,23 @@ struct sway_seat {
73 struct wlr_seat *wlr_seat; 84 struct wlr_seat *wlr_seat;
74 struct sway_cursor *cursor; 85 struct sway_cursor *cursor;
75 86
87 // Seat scene tree structure
88 // - scene_tree
89 // - drag icons
90 // - drag icon 1
91 // - drag icon 2
92 // - seatop specific stuff
93 struct wlr_scene_tree *scene_tree;
94 struct wlr_scene_tree *drag_icons;
95
76 bool has_focus; 96 bool has_focus;
77 struct wl_list focus_stack; // list of containers in focus order 97 struct wl_list focus_stack; // list of containers in focus order
78 struct sway_workspace *workspace; 98 struct sway_workspace *workspace;
79 char *prev_workspace_name; // for workspace back_and_forth 99 char *prev_workspace_name; // for workspace back_and_forth
80 100
81 // If the focused layer is set, views cannot receive keyboard focus
82 struct wlr_layer_surface_v1 *focused_layer; 101 struct wlr_layer_surface_v1 *focused_layer;
83 102 // If the exclusive layer is set, views cannot receive keyboard focus
84 // If exclusive_client is set, no other clients will receive input events 103 bool has_exclusive_layer;
85 struct wl_client *exclusive_client;
86 104
87 // Last touch point 105 // Last touch point
88 int32_t touch_id; 106 int32_t touch_id;
@@ -141,6 +159,9 @@ void seat_add_device(struct sway_seat *seat,
141void seat_configure_device(struct sway_seat *seat, 159void seat_configure_device(struct sway_seat *seat,
142 struct sway_input_device *device); 160 struct sway_input_device *device);
143 161
162void seat_configure_device_mapping(struct sway_seat *seat,
163 struct sway_input_device *input_device);
164
144void seat_reset_device(struct sway_seat *seat, 165void seat_reset_device(struct sway_seat *seat,
145 struct sway_input_device *input_device); 166 struct sway_input_device *input_device);
146 167
@@ -171,8 +192,7 @@ void seat_set_focus_surface(struct sway_seat *seat,
171void seat_set_focus_layer(struct sway_seat *seat, 192void seat_set_focus_layer(struct sway_seat *seat,
172 struct wlr_layer_surface_v1 *layer); 193 struct wlr_layer_surface_v1 *layer);
173 194
174void seat_set_exclusive_client(struct sway_seat *seat, 195void seat_unfocus_unless_client(struct sway_seat *seat, struct wl_client *client);
175 struct wl_client *client);
176 196
177struct sway_node *seat_get_focus(struct sway_seat *seat); 197struct sway_node *seat_get_focus(struct sway_seat *seat);
178 198
@@ -231,7 +251,7 @@ void seat_idle_notify_activity(struct sway_seat *seat,
231 251
232bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); 252bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
233 253
234void drag_icon_update_position(struct sway_drag_icon *icon); 254void drag_icons_update_position(struct sway_seat *seat);
235 255
236enum wlr_edges find_resize_edge(struct sway_container *cont, 256enum wlr_edges find_resize_edge(struct sway_container *cont,
237 struct wlr_surface *surface, struct sway_cursor *cursor); 257 struct wlr_surface *surface, struct sway_cursor *cursor);
@@ -239,7 +259,13 @@ enum wlr_edges find_resize_edge(struct sway_container *cont,
239void seatop_begin_default(struct sway_seat *seat); 259void seatop_begin_default(struct sway_seat *seat);
240 260
241void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, 261void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
242 uint32_t time_msec, int sx, int sy); 262 double sx, double sy);
263
264void seatop_begin_down_on_surface(struct sway_seat *seat,
265 struct wlr_surface *surface, double sx, double sy);
266
267void seatop_begin_touch_down(struct sway_seat *seat, struct wlr_surface *surface,
268 struct wlr_touch_down_event *event, double sx, double sy, double lx, double ly);
243 269
244void seatop_begin_move_floating(struct sway_seat *seat, 270void seatop_begin_move_floating(struct sway_seat *seat,
245 struct sway_container *con); 271 struct sway_container *con);
@@ -271,7 +297,7 @@ void seatop_button(struct sway_seat *seat, uint32_t time_msec,
271void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec); 297void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec);
272 298
273void seatop_pointer_axis(struct sway_seat *seat, 299void seatop_pointer_axis(struct sway_seat *seat,
274 struct wlr_event_pointer_axis *event); 300 struct wlr_pointer_axis_event *event);
275 301
276void seatop_tablet_tool_tip(struct sway_seat *seat, 302void seatop_tablet_tool_tip(struct sway_seat *seat,
277 struct sway_tablet_tool *tool, uint32_t time_msec, 303 struct sway_tablet_tool *tool, uint32_t time_msec,
@@ -280,6 +306,37 @@ void seatop_tablet_tool_tip(struct sway_seat *seat,
280void seatop_tablet_tool_motion(struct sway_seat *seat, 306void seatop_tablet_tool_motion(struct sway_seat *seat,
281 struct sway_tablet_tool *tool, uint32_t time_msec); 307 struct sway_tablet_tool *tool, uint32_t time_msec);
282 308
309void seatop_hold_begin(struct sway_seat *seat,
310 struct wlr_pointer_hold_begin_event *event);
311void seatop_hold_end(struct sway_seat *seat,
312 struct wlr_pointer_hold_end_event *event);
313
314void seatop_pinch_begin(struct sway_seat *seat,
315 struct wlr_pointer_pinch_begin_event *event);
316void seatop_pinch_update(struct sway_seat *seat,
317 struct wlr_pointer_pinch_update_event *event);
318void seatop_pinch_end(struct sway_seat *seat,
319 struct wlr_pointer_pinch_end_event *event);
320
321void seatop_swipe_begin(struct sway_seat *seat,
322 struct wlr_pointer_swipe_begin_event *event);
323void seatop_swipe_update(struct sway_seat *seat,
324 struct wlr_pointer_swipe_update_event *event);
325void seatop_swipe_end(struct sway_seat *seat,
326 struct wlr_pointer_swipe_end_event *event);
327
328void seatop_touch_motion(struct sway_seat *seat,
329 struct wlr_touch_motion_event *event, double lx, double ly);
330
331void seatop_touch_up(struct sway_seat *seat,
332 struct wlr_touch_up_event *event);
333
334void seatop_touch_down(struct sway_seat *seat,
335 struct wlr_touch_down_event *event, double lx, double ly);
336
337void seatop_touch_cancel(struct sway_seat *seat,
338 struct wlr_touch_cancel_event *event);
339
283void seatop_rebase(struct sway_seat *seat, uint32_t time_msec); 340void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
284 341
285/** 342/**
@@ -294,13 +351,6 @@ void seatop_end(struct sway_seat *seat);
294 */ 351 */
295void seatop_unref(struct sway_seat *seat, struct sway_container *con); 352void seatop_unref(struct sway_seat *seat, struct sway_container *con);
296 353
297/**
298 * Instructs a seatop to render anything that it needs to render
299 * (eg. dropzone for move-tiling)
300 */
301void seatop_render(struct sway_seat *seat, struct sway_output *output,
302 pixman_region32_t *damage);
303
304bool seatop_allows_set_cursor(struct sway_seat *seat); 354bool seatop_allows_set_cursor(struct sway_seat *seat);
305 355
306/** 356/**