aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/input')
-rw-r--r--include/sway/input/cursor.h15
-rw-r--r--include/sway/input/input-manager.h8
-rw-r--r--include/sway/input/keyboard.h1
-rw-r--r--include/sway/input/libinput.h5
-rw-r--r--include/sway/input/seat.h120
-rw-r--r--include/sway/input/switch.h1
-rw-r--r--include/sway/input/tablet.h3
-rw-r--r--include/sway/input/text_input.h6
-rw-r--r--include/sway/input/text_input_popup.h20
9 files changed, 130 insertions, 49 deletions
diff --git a/include/sway/input/cursor.h b/include/sway/input/cursor.h
index 3a71a35f..527d0350 100644
--- a/include/sway/input/cursor.h
+++ b/include/sway/input/cursor.h
@@ -35,15 +35,14 @@ struct sway_cursor {
35 pixman_region32_t confine; // invalid if active_constraint == NULL 35 pixman_region32_t confine; // invalid if active_constraint == NULL
36 bool active_confine_requires_warp; 36 bool active_confine_requires_warp;
37 37
38 struct wlr_pointer_gestures_v1 *pointer_gestures; 38 struct wl_listener hold_begin;
39 struct wl_listener hold_end;
39 struct wl_listener pinch_begin; 40 struct wl_listener pinch_begin;
40 struct wl_listener pinch_update; 41 struct wl_listener pinch_update;
41 struct wl_listener pinch_end; 42 struct wl_listener pinch_end;
42 struct wl_listener swipe_begin; 43 struct wl_listener swipe_begin;
43 struct wl_listener swipe_update; 44 struct wl_listener swipe_update;
44 struct wl_listener swipe_end; 45 struct wl_listener swipe_end;
45 struct wl_listener hold_begin;
46 struct wl_listener hold_end;
47 46
48 struct wl_listener motion; 47 struct wl_listener motion;
49 struct wl_listener motion_absolute; 48 struct wl_listener motion_absolute;
@@ -53,6 +52,7 @@ struct sway_cursor {
53 52
54 struct wl_listener touch_down; 53 struct wl_listener touch_down;
55 struct wl_listener touch_up; 54 struct wl_listener touch_up;
55 struct wl_listener touch_cancel;
56 struct wl_listener touch_motion; 56 struct wl_listener touch_motion;
57 struct wl_listener touch_frame; 57 struct wl_listener touch_frame;
58 bool simulating_pointer_from_touch; 58 bool simulating_pointer_from_touch;
@@ -64,6 +64,7 @@ struct sway_cursor {
64 struct wl_listener tool_proximity; 64 struct wl_listener tool_proximity;
65 struct wl_listener tool_button; 65 struct wl_listener tool_button;
66 bool simulating_pointer_from_tool_tip; 66 bool simulating_pointer_from_tool_tip;
67 bool simulating_pointer_from_tool_button;
67 uint32_t tool_buttons; 68 uint32_t tool_buttons;
68 69
69 struct wl_listener request_set_cursor; 70 struct wl_listener request_set_cursor;
@@ -107,9 +108,13 @@ void cursor_unhide(struct sway_cursor *cursor);
107int cursor_get_timeout(struct sway_cursor *cursor); 108int cursor_get_timeout(struct sway_cursor *cursor);
108void cursor_notify_key_press(struct sway_cursor *cursor); 109void cursor_notify_key_press(struct sway_cursor *cursor);
109 110
111void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
112 struct wlr_input_device *device, double dx, double dy,
113 double dx_unaccel, double dy_unaccel);
114
110void dispatch_cursor_button(struct sway_cursor *cursor, 115void dispatch_cursor_button(struct sway_cursor *cursor,
111 struct wlr_input_device *device, uint32_t time_msec, uint32_t button, 116 struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
112 enum wlr_button_state state); 117 enum wl_pointer_button_state state);
113 118
114void dispatch_cursor_axis(struct sway_cursor *cursor, 119void dispatch_cursor_axis(struct sway_cursor *cursor,
115 struct wlr_pointer_axis_event *event); 120 struct wlr_pointer_axis_event *event);
@@ -140,4 +145,6 @@ uint32_t get_mouse_button(const char *name, char **error);
140 145
141const char *get_mouse_button_name(uint32_t button); 146const char *get_mouse_button_name(uint32_t button);
142 147
148void handle_request_set_cursor_shape(struct wl_listener *listener, void *data);
149
143#endif 150#endif
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h
index c9bd08f0..45c75199 100644
--- a/include/sway/input/input-manager.h
+++ b/include/sway/input/input-manager.h
@@ -1,10 +1,10 @@
1#ifndef _SWAY_INPUT_INPUT_MANAGER_H 1#ifndef _SWAY_INPUT_INPUT_MANAGER_H
2#define _SWAY_INPUT_INPUT_MANAGER_H 2#define _SWAY_INPUT_INPUT_MANAGER_H
3#include <libinput.h> 3#include <libinput.h>
4#include <wlr/types/wlr_input_inhibitor.h>
5#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> 4#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
6#include <wlr/types/wlr_virtual_keyboard_v1.h> 5#include <wlr/types/wlr_virtual_keyboard_v1.h>
7#include <wlr/types/wlr_virtual_pointer_v1.h> 6#include <wlr/types/wlr_virtual_pointer_v1.h>
7#include <wlr/types/wlr_transient_seat_v1.h>
8#include "sway/server.h" 8#include "sway/server.h"
9#include "sway/config.h" 9#include "sway/config.h"
10#include "list.h" 10#include "list.h"
@@ -21,10 +21,11 @@ struct sway_input_manager {
21 struct wl_list devices; 21 struct wl_list devices;
22 struct wl_list seats; 22 struct wl_list seats;
23 23
24 struct wlr_input_inhibit_manager *inhibit;
25 struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit; 24 struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
26 struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; 25 struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
27 struct wlr_virtual_pointer_manager_v1 *virtual_pointer; 26 struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
27 struct wlr_pointer_gestures_v1 *pointer_gestures;
28 struct wlr_transient_seat_manager_v1 *transient_seat_manager;
28 29
29 struct wl_listener new_input; 30 struct wl_listener new_input;
30 struct wl_listener inhibit_activate; 31 struct wl_listener inhibit_activate;
@@ -32,6 +33,7 @@ struct sway_input_manager {
32 struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor; 33 struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor;
33 struct wl_listener virtual_keyboard_new; 34 struct wl_listener virtual_keyboard_new;
34 struct wl_listener virtual_pointer_new; 35 struct wl_listener virtual_pointer_new;
36 struct wl_listener transient_seat_create;
35}; 37};
36 38
37struct sway_input_manager *input_manager_create(struct sway_server *server); 39struct sway_input_manager *input_manager_create(struct sway_server *server);
@@ -44,7 +46,7 @@ void input_manager_configure_xcursor(void);
44 46
45void input_manager_apply_input_config(struct input_config *input_config); 47void input_manager_apply_input_config(struct input_config *input_config);
46 48
47void input_manager_configure_all_inputs(void); 49void input_manager_configure_all_input_mappings(void);
48 50
49void input_manager_reset_input(struct sway_input_device *input_device); 51void input_manager_reset_input(struct sway_input_device *input_device);
50 52
diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h
index 2c61e5a7..571d9e6f 100644
--- a/include/sway/input/keyboard.h
+++ b/include/sway/input/keyboard.h
@@ -50,6 +50,7 @@ struct sway_shortcut_state {
50 50
51struct sway_keyboard { 51struct sway_keyboard {
52 struct sway_seat_device *seat_device; 52 struct sway_seat_device *seat_device;
53 struct wlr_keyboard *wlr;
53 54
54 struct xkb_keymap *keymap; 55 struct xkb_keymap *keymap;
55 xkb_layout_index_t effective_layout; 56 xkb_layout_index_t effective_layout;
diff --git a/include/sway/input/libinput.h b/include/sway/input/libinput.h
index 890d632e..1f84a8e3 100644
--- a/include/sway/input/libinput.h
+++ b/include/sway/input/libinput.h
@@ -2,7 +2,10 @@
2#define _SWAY_INPUT_LIBINPUT_H 2#define _SWAY_INPUT_LIBINPUT_H
3#include "sway/input/input-manager.h" 3#include "sway/input/input-manager.h"
4 4
5void sway_input_configure_libinput_device(struct sway_input_device *device); 5bool sway_input_configure_libinput_device(struct sway_input_device *device);
6
7void sway_input_configure_libinput_device_send_events(
8 struct sway_input_device *device);
6 9
7void sway_input_reset_libinput_device(struct sway_input_device *device); 10void sway_input_reset_libinput_device(struct sway_input_device *device);
8 11
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index 47726159..428f9679 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"
@@ -15,19 +17,41 @@ struct sway_seat;
15struct sway_seatop_impl { 17struct sway_seatop_impl {
16 void (*button)(struct sway_seat *seat, uint32_t time_msec, 18 void (*button)(struct sway_seat *seat, uint32_t time_msec,
17 struct wlr_input_device *device, uint32_t button, 19 struct wlr_input_device *device, uint32_t button,
18 enum wlr_button_state state); 20 enum wl_pointer_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_pointer_axis_event *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;
@@ -106,6 +124,7 @@ struct sway_seat {
106 struct wl_listener start_drag; 124 struct wl_listener start_drag;
107 struct wl_listener request_set_selection; 125 struct wl_listener request_set_selection;
108 struct wl_listener request_set_primary_selection; 126 struct wl_listener request_set_primary_selection;
127 struct wl_listener destroy;
109 128
110 struct wl_list devices; // sway_seat_device::link 129 struct wl_list devices; // sway_seat_device::link
111 struct wl_list keyboard_groups; // sway_keyboard_group::link 130 struct wl_list keyboard_groups; // sway_keyboard_group::link
@@ -141,6 +160,9 @@ void seat_add_device(struct sway_seat *seat,
141void seat_configure_device(struct sway_seat *seat, 160void seat_configure_device(struct sway_seat *seat,
142 struct sway_input_device *device); 161 struct sway_input_device *device);
143 162
163void seat_configure_device_mapping(struct sway_seat *seat,
164 struct sway_input_device *input_device);
165
144void seat_reset_device(struct sway_seat *seat, 166void seat_reset_device(struct sway_seat *seat,
145 struct sway_input_device *input_device); 167 struct sway_input_device *input_device);
146 168
@@ -171,8 +193,7 @@ void seat_set_focus_surface(struct sway_seat *seat,
171void seat_set_focus_layer(struct sway_seat *seat, 193void seat_set_focus_layer(struct sway_seat *seat,
172 struct wlr_layer_surface_v1 *layer); 194 struct wlr_layer_surface_v1 *layer);
173 195
174void seat_set_exclusive_client(struct sway_seat *seat, 196void seat_unfocus_unless_client(struct sway_seat *seat, struct wl_client *client);
175 struct wl_client *client);
176 197
177struct sway_node *seat_get_focus(struct sway_seat *seat); 198struct sway_node *seat_get_focus(struct sway_seat *seat);
178 199
@@ -185,10 +206,6 @@ struct sway_workspace *seat_get_last_known_workspace(struct sway_seat *seat);
185 206
186struct sway_container *seat_get_focused_container(struct sway_seat *seat); 207struct sway_container *seat_get_focused_container(struct sway_seat *seat);
187 208
188// Force focus to a particular surface that is not part of the workspace
189// hierarchy (used for lockscreen)
190void sway_force_focus(struct wlr_surface *surface);
191
192/** 209/**
193 * Return the last container to be focused for the seat (or the most recently 210 * Return the last container to be focused for the seat (or the most recently
194 * opened if no container has received focused) that is a child of the given 211 * opened if no container has received focused) that is a child of the given
@@ -235,7 +252,7 @@ void seat_idle_notify_activity(struct sway_seat *seat,
235 252
236bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface); 253bool seat_is_input_allowed(struct sway_seat *seat, struct wlr_surface *surface);
237 254
238void drag_icon_update_position(struct sway_drag_icon *icon); 255void drag_icons_update_position(struct sway_seat *seat);
239 256
240enum wlr_edges find_resize_edge(struct sway_container *cont, 257enum wlr_edges find_resize_edge(struct sway_container *cont,
241 struct wlr_surface *surface, struct sway_cursor *cursor); 258 struct wlr_surface *surface, struct sway_cursor *cursor);
@@ -243,10 +260,13 @@ enum wlr_edges find_resize_edge(struct sway_container *cont,
243void seatop_begin_default(struct sway_seat *seat); 260void seatop_begin_default(struct sway_seat *seat);
244 261
245void seatop_begin_down(struct sway_seat *seat, struct sway_container *con, 262void seatop_begin_down(struct sway_seat *seat, struct sway_container *con,
246 uint32_t time_msec, double sx, double sy); 263 double sx, double sy);
247 264
248void seatop_begin_down_on_surface(struct sway_seat *seat, 265void seatop_begin_down_on_surface(struct sway_seat *seat,
249 struct wlr_surface *surface, uint32_t time_msec, double sx, double sy); 266 struct wlr_surface *surface, double sx, double sy);
267
268void seatop_begin_touch_down(struct sway_seat *seat, struct wlr_surface *surface,
269 struct wlr_touch_down_event *event, double sx, double sy, double lx, double ly);
250 270
251void seatop_begin_move_floating(struct sway_seat *seat, 271void seatop_begin_move_floating(struct sway_seat *seat,
252 struct sway_container *con); 272 struct sway_container *con);
@@ -267,13 +287,13 @@ struct sway_container *seat_get_focus_inactive_floating(struct sway_seat *seat,
267 struct sway_workspace *workspace); 287 struct sway_workspace *workspace);
268 288
269void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec, 289void seat_pointer_notify_button(struct sway_seat *seat, uint32_t time_msec,
270 uint32_t button, enum wlr_button_state state); 290 uint32_t button, enum wl_pointer_button_state state);
271 291
272void seat_consider_warp_to_focus(struct sway_seat *seat); 292void seat_consider_warp_to_focus(struct sway_seat *seat);
273 293
274void seatop_button(struct sway_seat *seat, uint32_t time_msec, 294void seatop_button(struct sway_seat *seat, uint32_t time_msec,
275 struct wlr_input_device *device, uint32_t button, 295 struct wlr_input_device *device, uint32_t button,
276 enum wlr_button_state state); 296 enum wl_pointer_button_state state);
277 297
278void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec); 298void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec);
279 299
@@ -287,6 +307,37 @@ void seatop_tablet_tool_tip(struct sway_seat *seat,
287void seatop_tablet_tool_motion(struct sway_seat *seat, 307void seatop_tablet_tool_motion(struct sway_seat *seat,
288 struct sway_tablet_tool *tool, uint32_t time_msec); 308 struct sway_tablet_tool *tool, uint32_t time_msec);
289 309
310void seatop_hold_begin(struct sway_seat *seat,
311 struct wlr_pointer_hold_begin_event *event);
312void seatop_hold_end(struct sway_seat *seat,
313 struct wlr_pointer_hold_end_event *event);
314
315void seatop_pinch_begin(struct sway_seat *seat,
316 struct wlr_pointer_pinch_begin_event *event);
317void seatop_pinch_update(struct sway_seat *seat,
318 struct wlr_pointer_pinch_update_event *event);
319void seatop_pinch_end(struct sway_seat *seat,
320 struct wlr_pointer_pinch_end_event *event);
321
322void seatop_swipe_begin(struct sway_seat *seat,
323 struct wlr_pointer_swipe_begin_event *event);
324void seatop_swipe_update(struct sway_seat *seat,
325 struct wlr_pointer_swipe_update_event *event);
326void seatop_swipe_end(struct sway_seat *seat,
327 struct wlr_pointer_swipe_end_event *event);
328
329void seatop_touch_motion(struct sway_seat *seat,
330 struct wlr_touch_motion_event *event, double lx, double ly);
331
332void seatop_touch_up(struct sway_seat *seat,
333 struct wlr_touch_up_event *event);
334
335void seatop_touch_down(struct sway_seat *seat,
336 struct wlr_touch_down_event *event, double lx, double ly);
337
338void seatop_touch_cancel(struct sway_seat *seat,
339 struct wlr_touch_cancel_event *event);
340
290void seatop_rebase(struct sway_seat *seat, uint32_t time_msec); 341void seatop_rebase(struct sway_seat *seat, uint32_t time_msec);
291 342
292/** 343/**
@@ -301,13 +352,6 @@ void seatop_end(struct sway_seat *seat);
301 */ 352 */
302void seatop_unref(struct sway_seat *seat, struct sway_container *con); 353void seatop_unref(struct sway_seat *seat, struct sway_container *con);
303 354
304/**
305 * Instructs a seatop to render anything that it needs to render
306 * (eg. dropzone for move-tiling)
307 */
308void seatop_render(struct sway_seat *seat, struct sway_output *output,
309 pixman_region32_t *damage);
310
311bool seatop_allows_set_cursor(struct sway_seat *seat); 355bool seatop_allows_set_cursor(struct sway_seat *seat);
312 356
313/** 357/**
diff --git a/include/sway/input/switch.h b/include/sway/input/switch.h
index 213b471d..de6787b7 100644
--- a/include/sway/input/switch.h
+++ b/include/sway/input/switch.h
@@ -5,6 +5,7 @@
5 5
6struct sway_switch { 6struct sway_switch {
7 struct sway_seat_device *seat_device; 7 struct sway_seat_device *seat_device;
8 struct wlr_switch *wlr;
8 enum wlr_switch_state state; 9 enum wlr_switch_state state;
9 enum wlr_switch_type type; 10 enum wlr_switch_type type;
10 11
diff --git a/include/sway/input/tablet.h b/include/sway/input/tablet.h
index d7e4c242..2fa5db6d 100644
--- a/include/sway/input/tablet.h
+++ b/include/sway/input/tablet.h
@@ -32,6 +32,7 @@ struct sway_tablet_pad {
32 struct wl_list link; 32 struct wl_list link;
33 struct sway_seat_device *seat_device; 33 struct sway_seat_device *seat_device;
34 struct sway_tablet *tablet; 34 struct sway_tablet *tablet;
35 struct wlr_tablet_pad *wlr;
35 struct wlr_tablet_v2_tablet_pad *tablet_v2_pad; 36 struct wlr_tablet_v2_tablet_pad *tablet_v2_pad;
36 37
37 struct wl_listener attach; 38 struct wl_listener attach;
@@ -62,7 +63,7 @@ void sway_configure_tablet_pad(struct sway_tablet_pad *tablet_pad);
62 63
63void sway_tablet_pad_destroy(struct sway_tablet_pad *tablet_pad); 64void sway_tablet_pad_destroy(struct sway_tablet_pad *tablet_pad);
64 65
65void sway_tablet_pad_notify_enter(struct sway_tablet_pad *tablet_pad, 66void sway_tablet_pad_set_focus(struct sway_tablet_pad *tablet_pad,
66 struct wlr_surface *surface); 67 struct wlr_surface *surface);
67 68
68#endif 69#endif
diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h
index c70fd935..1993f928 100644
--- a/include/sway/input/text_input.h
+++ b/include/sway/input/text_input.h
@@ -4,12 +4,11 @@
4#include <wlr/types/wlr_text_input_v3.h> 4#include <wlr/types/wlr_text_input_v3.h>
5#include <wlr/types/wlr_input_method_v2.h> 5#include <wlr/types/wlr_input_method_v2.h>
6#include <wlr/types/wlr_compositor.h> 6#include <wlr/types/wlr_compositor.h>
7#include "sway/input/seat.h"
8 7
9/** 8/**
10 * The relay structure manages the relationship between text-input and 9 * The relay structure manages the relationship between text-input and
11 * input_method interfaces on a given seat. Multiple text-input interfaces may 10 * input_method interfaces on a given seat. Multiple text-input interfaces may
12 * be bound to a relay, but at most one will be focused (reveiving events) at 11 * be bound to a relay, but at most one will be focused (receiving events) at
13 * a time. At most one input-method interface may be bound to the seat. The 12 * a time. At most one input-method interface may be bound to the seat. The
14 * relay manages life cycle of both sides. When both sides are present and 13 * relay manages life cycle of both sides. When both sides are present and
15 * focused, the relay passes messages between them. 14 * focused, the relay passes messages between them.
@@ -22,18 +21,21 @@ struct sway_input_method_relay {
22 struct sway_seat *seat; 21 struct sway_seat *seat;
23 22
24 struct wl_list text_inputs; // sway_text_input::link 23 struct wl_list text_inputs; // sway_text_input::link
24 struct wl_list input_popups; // sway_input_popup::link
25 struct wlr_input_method_v2 *input_method; // doesn't have to be present 25 struct wlr_input_method_v2 *input_method; // doesn't have to be present
26 26
27 struct wl_listener text_input_new; 27 struct wl_listener text_input_new;
28 28
29 struct wl_listener input_method_new; 29 struct wl_listener input_method_new;
30 struct wl_listener input_method_commit; 30 struct wl_listener input_method_commit;
31 struct wl_listener input_method_new_popup_surface;
31 struct wl_listener input_method_grab_keyboard; 32 struct wl_listener input_method_grab_keyboard;
32 struct wl_listener input_method_destroy; 33 struct wl_listener input_method_destroy;
33 34
34 struct wl_listener input_method_keyboard_grab_destroy; 35 struct wl_listener input_method_keyboard_grab_destroy;
35}; 36};
36 37
38
37struct sway_text_input { 39struct sway_text_input {
38 struct sway_input_method_relay *relay; 40 struct sway_input_method_relay *relay;
39 41
diff --git a/include/sway/input/text_input_popup.h b/include/sway/input/text_input_popup.h
new file mode 100644
index 00000000..e5f6ab8b
--- /dev/null
+++ b/include/sway/input/text_input_popup.h
@@ -0,0 +1,20 @@
1#ifndef _SWAY_INPUT_TEXT_INPUT_POPUP_H
2#define _SWAY_INPUT_TEXT_INPUT_POPUP_H
3
4#include "sway/tree/view.h"
5
6struct sway_input_popup {
7 struct sway_input_method_relay *relay;
8
9 struct wlr_scene_tree *scene_tree;
10 struct sway_popup_desc desc;
11 struct wlr_input_popup_surface_v2 *popup_surface;
12
13 struct wl_list link;
14
15 struct wl_listener popup_destroy;
16 struct wl_listener popup_surface_commit;
17
18 struct wl_listener focused_surface_unmap;
19};
20#endif