aboutsummaryrefslogtreecommitdiff
path: root/sway/input/seat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/seat.c')
-rw-r--r--sway/input/seat.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index aa46940d..a4e06c57 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1499,16 +1499,22 @@ bool seatop_allows_set_cursor(struct sway_seat *seat) {
}
struct sway_keyboard_shortcuts_inhibitor *
-keyboard_shortcuts_inhibitor_get_for_focused_surface(
- const struct sway_seat *seat) {
- struct wlr_surface *focused_surface =
- seat->wlr_seat->keyboard_state.focused_surface;
+keyboard_shortcuts_inhibitor_get_for_surface(
+ const struct sway_seat *seat,
+ const struct wlr_surface *surface) {
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor = NULL;
wl_list_for_each(sway_inhibitor, &seat->keyboard_shortcuts_inhibitors, link) {
- if (sway_inhibitor->inhibitor->surface == focused_surface) {
+ if (sway_inhibitor->inhibitor->surface == surface) {
return sway_inhibitor;
}
}
return NULL;
}
+
+struct sway_keyboard_shortcuts_inhibitor *
+keyboard_shortcuts_inhibitor_get_for_focused_surface(
+ const struct sway_seat *seat) {
+ return keyboard_shortcuts_inhibitor_get_for_surface(seat,
+ seat->wlr_seat->keyboard_state.focused_surface);
+}