aboutsummaryrefslogtreecommitdiff
path: root/include/sway
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/config.h1
-rw-r--r--include/sway/input/input-manager.h3
-rw-r--r--include/sway/input/seat.h18
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 {
BINDING_TITLEBAR=16, // mouse only; trigger on container titlebar
BINDING_CODE=32, // keyboard only; convert keysyms into keycodes
BINDING_RELOAD=64, // switch only; (re)trigger binding on reload
+ BINDING_INHIBITED=128, // keyboard only: ignore shortcut inhibitor
};
/**
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 @@
#define _SWAY_INPUT_INPUT_MANAGER_H
#include <libinput.h>
#include <wlr/types/wlr_input_inhibitor.h>
+#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_virtual_pointer_v1.h>
#include "sway/server.h"
@@ -20,12 +21,14 @@ struct sway_input_manager {
struct wl_list seats;
struct wlr_input_inhibit_manager *inhibit;
+ struct wlr_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard;
struct wlr_virtual_pointer_manager_v1 *virtual_pointer;
struct wl_listener new_input;
struct wl_listener inhibit_activate;
struct wl_listener inhibit_deactivate;
+ struct wl_listener keyboard_shortcuts_inhibit_new_inhibitor;
struct wl_listener virtual_keyboard_new;
struct wl_listener virtual_pointer_new;
};
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 @@
#ifndef _SWAY_INPUT_SEAT_H
#define _SWAY_INPUT_SEAT_H
+#include <wlr/types/wlr_keyboard_shortcuts_inhibit_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/util/edges.h>
@@ -94,6 +95,8 @@ struct sway_seat {
struct wl_list devices; // sway_seat_device::link
struct wl_list keyboard_groups; // sway_keyboard_group::link
+ struct wl_list keyboard_shortcuts_inhibitors;
+ // sway_keyboard_shortcuts_inhibitor::link
struct wl_list link; // input_manager::seats
};
@@ -104,6 +107,14 @@ struct sway_pointer_constraint {
struct wl_listener destroy;
};
+struct sway_keyboard_shortcuts_inhibitor {
+ struct wlr_keyboard_shortcuts_inhibitor_v1 *inhibitor;
+
+ struct wl_listener destroy;
+
+ struct wl_list link; // sway_seat::keyboard_shortcuts_inhibitors
+};
+
struct sway_seat *seat_create(const char *seat_name);
void seat_destroy(struct sway_seat *seat);
@@ -269,4 +280,11 @@ void seatop_render(struct sway_seat *seat, struct sway_output *output,
bool seatop_allows_set_cursor(struct sway_seat *seat);
+/**
+ * Returns the keyboard shortcuts inhibitor that applies to the currently
+ * focused surface of a seat or NULL if none exists.
+ */
+struct sway_keyboard_shortcuts_inhibitor *
+keyboard_shortcuts_inhibitor_get_for_focused_surface(const struct sway_seat *seat);
+
#endif