aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/input-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r--sway/input/input-manager.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c
index 243f860b..dc07cbf0 100644
--- a/sway/input/input-manager.c
+++ b/sway/input/input-manager.c
@@ -15,6 +15,7 @@
15#include "sway/input/cursor.h" 15#include "sway/input/cursor.h"
16#include "sway/ipc-server.h" 16#include "sway/ipc-server.h"
17#include "sway/server.h" 17#include "sway/server.h"
18#include "sway/tree/view.h"
18#include "stringop.h" 19#include "stringop.h"
19#include "list.h" 20#include "list.h"
20#include "log.h" 21#include "log.h"
@@ -333,12 +334,25 @@ static void handle_keyboard_shortcuts_inhibit_new_inhibitor(
333 struct sway_seat *seat = inhibitor->seat->data; 334 struct sway_seat *seat = inhibitor->seat->data;
334 wl_list_insert(&seat->keyboard_shortcuts_inhibitors, &sway_inhibitor->link); 335 wl_list_insert(&seat->keyboard_shortcuts_inhibitors, &sway_inhibitor->link);
335 336
336 struct seat_config *config = seat_get_config(seat); 337 // per-view, seat-agnostic config via criteria
337 if (!config) { 338 struct sway_view *view = view_from_wlr_surface(inhibitor->surface);
338 config = seat_get_config_by_name("*"); 339 enum seat_config_shortcuts_inhibit inhibit = SHORTCUTS_INHIBIT_DEFAULT;
340 if (view) {
341 inhibit = view->shortcuts_inhibit;
339 } 342 }
340 343
341 if (config && config->shortcuts_inhibit == SHORTCUTS_INHIBIT_DISABLE) { 344 if (inhibit == SHORTCUTS_INHIBIT_DEFAULT) {
345 struct seat_config *config = seat_get_config(seat);
346 if (!config) {
347 config = seat_get_config_by_name("*");
348 }
349
350 if (config) {
351 inhibit = config->shortcuts_inhibit;
352 }
353 }
354
355 if (inhibit == SHORTCUTS_INHIBIT_DISABLE) {
342 /** 356 /**
343 * Here we deny to honour the inhibitor by never sending the 357 * Here we deny to honour the inhibitor by never sending the
344 * activate signal. We can not, however, destroy the inhibitor 358 * activate signal. We can not, however, destroy the inhibitor