diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/config.h | 1 | ||||
-rw-r--r-- | include/sway/input/input-manager.h | 3 | ||||
-rw-r--r-- | include/sway/input/seat.h | 18 |
3 files changed, 22 insertions, 0 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 5f02e44f..fdd65efd 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -40,6 +40,7 @@ enum binding_flags { | |||
40 | BINDING_TITLEBAR=16, // mouse only; trigger on container titlebar | 40 | BINDING_TITLEBAR=16, // mouse only; trigger on container titlebar |
41 | BINDING_CODE=32, // keyboard only; convert keysyms into keycodes | 41 | BINDING_CODE=32, // keyboard only; convert keysyms into keycodes |
42 | BINDING_RELOAD=64, // switch only; (re)trigger binding on reload | 42 | BINDING_RELOAD=64, // switch only; (re)trigger binding on reload |
43 | BINDING_INHIBITED=128, // keyboard only: ignore shortcut inhibitor | ||
43 | }; | 44 | }; |
44 | 45 | ||
45 | /** | 46 | /** |
diff --git a/include/sway/input/input-manager.h b/include/sway/input/input-manager.h index a5392c6b..410d17a8 100644 --- a/include/sway/input/input-manager.h +++ b/include/sway/input/input-manager.h | |||
@@ -2,6 +2,7 @@ | |||
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> | 4 | #include <wlr/types/wlr_input_inhibitor.h> |
5 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> | ||
5 | #include <wlr/types/wlr_virtual_keyboard_v1.h> | 6 | #include <wlr/types/wlr_virtual_keyboard_v1.h> |
6 | #include <wlr/types/wlr_virtual_pointer_v1.h> | 7 | #include <wlr/types/wlr_virtual_pointer_v1.h> |
7 | #include "sway/server.h" | 8 | #include "sway/server.h" |
@@ -20,12 +21,14 @@ struct sway_input_manager { | |||
20 | struct wl_list seats; | 21 | struct wl_list seats; |
21 | 22 | ||
22 | struct wlr_input_inhibit_manager *inhibit; | 23 | struct wlr_input_inhibit_manager *inhibit; |
24 | struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit; | ||
23 | struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; | 25 | struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; |
24 | struct wlr_virtual_pointer_manager_v1 *virtual_pointer; | 26 | struct wlr_virtual_pointer_manager_v1 *virtual_pointer; |
25 | 27 | ||
26 | struct wl_listener new_input; | 28 | struct wl_listener new_input; |
27 | struct wl_listener inhibit_activate; | 29 | struct wl_listener inhibit_activate; |
28 | struct wl_listener inhibit_deactivate; | 30 | struct wl_listener inhibit_deactivate; |
31 | struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor; | ||
29 | struct wl_listener virtual_keyboard_new; | 32 | struct wl_listener virtual_keyboard_new; |
30 | struct wl_listener virtual_pointer_new; | 33 | struct wl_listener virtual_pointer_new; |
31 | }; | 34 | }; |
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h index 9c3028c5..49b9d09b 100644 --- a/include/sway/input/seat.h +++ b/include/sway/input/seat.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _SWAY_INPUT_SEAT_H | 1 | #ifndef _SWAY_INPUT_SEAT_H |
2 | #define _SWAY_INPUT_SEAT_H | 2 | #define _SWAY_INPUT_SEAT_H |
3 | 3 | ||
4 | #include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h> | ||
4 | #include <wlr/types/wlr_layer_shell_v1.h> | 5 | #include <wlr/types/wlr_layer_shell_v1.h> |
5 | #include <wlr/types/wlr_seat.h> | 6 | #include <wlr/types/wlr_seat.h> |
6 | #include <wlr/util/edges.h> | 7 | #include <wlr/util/edges.h> |
@@ -94,6 +95,8 @@ struct sway_seat { | |||
94 | 95 | ||
95 | struct wl_list devices; // sway_seat_device::link | 96 | struct wl_list devices; // sway_seat_device::link |
96 | struct wl_list keyboard_groups; // sway_keyboard_group::link | 97 | struct wl_list keyboard_groups; // sway_keyboard_group::link |
98 | struct wl_list keyboard_shortcuts_inhibitors; | ||
99 | // sway_keyboard_shortcuts_inhibitor::link | ||
97 | 100 | ||
98 | struct wl_list link; // input_manager::seats | 101 | struct wl_list link; // input_manager::seats |
99 | }; | 102 | }; |
@@ -104,6 +107,14 @@ struct sway_pointer_constraint { | |||
104 | struct wl_listener destroy; | 107 | struct wl_listener destroy; |
105 | }; | 108 | }; |
106 | 109 | ||
110 | struct sway_keyboard_shortcuts_inhibitor { | ||
111 | struct wlr_keyboard_shortcuts_inhibitor_v1 *inhibitor; | ||
112 | |||
113 | struct wl_listener destroy; | ||
114 | |||
115 | struct wl_list link; // sway_seat::keyboard_shortcuts_inhibitors | ||
116 | }; | ||
117 | |||
107 | struct sway_seat *seat_create(const char *seat_name); | 118 | struct sway_seat *seat_create(const char *seat_name); |
108 | 119 | ||
109 | void seat_destroy(struct sway_seat *seat); | 120 | void seat_destroy(struct sway_seat *seat); |
@@ -269,4 +280,11 @@ void seatop_render(struct sway_seat *seat, struct sway_output *output, | |||
269 | 280 | ||
270 | bool seatop_allows_set_cursor(struct sway_seat *seat); | 281 | bool seatop_allows_set_cursor(struct sway_seat *seat); |
271 | 282 | ||
283 | /** | ||
284 | * Returns the keyboard shortcuts inhibitor that applies to the currently | ||
285 | * focused surface of a seat or NULL if none exists. | ||
286 | */ | ||
287 | struct sway_keyboard_shortcuts_inhibitor * | ||
288 | keyboard_shortcuts_inhibitor_get_for_focused_surface(const struct sway_seat *seat); | ||
289 | |||
272 | #endif | 290 | #endif |