aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-12-01 22:09:33 -0500
committerDrew DeVault <sir@cmpwn.com>2016-12-01 22:09:33 -0500
commit8aeeacf178b234cefd046aa4ea8ec9c076d3f7b1 (patch)
tree71be219183e97dc396b6653cd3f6dc253d7b27f2 /sway
parentffdbb9d05077db2a44ab0f307b09d6bdbd1cab27 (diff)
downloadsway-8aeeacf178b234cefd046aa4ea8ec9c076d3f7b1.tar.xz
Enforce keyboard permissions
Diffstat (limited to 'sway')
-rw-r--r--sway/handlers.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 24784330..3b85679d 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -725,6 +725,15 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier
}
list_free(candidates);
+
+ swayc_t *focused = get_focused_container(&root_container);
+ if (focused->type == C_VIEW) {
+ pid_t pid = wlc_view_get_pid(focused->handle);
+ if (!(get_feature_policy(pid) & FEATURE_KEYBOARD)) {
+ sway_log(L_INFO, "Denying keypress to %d (%s)", pid, focused->name);
+ return EVENT_HANDLED;
+ }
+ }
return EVENT_PASSTHROUGH;
}