diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-01 22:03:36 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-01 22:03:36 -0500 |
commit | ffdbb9d05077db2a44ab0f307b09d6bdbd1cab27 (patch) | |
tree | 065df35b6cb2a263a6e7531fa2b71de0a5919c92 | |
parent | Shut Clang up (diff) | |
download | sway-ffdbb9d05077db2a44ab0f307b09d6bdbd1cab27.tar.gz sway-ffdbb9d05077db2a44ab0f307b09d6bdbd1cab27.tar.zst sway-ffdbb9d05077db2a44ab0f307b09d6bdbd1cab27.zip |
Enforce fullscreen permissions
-rw-r--r-- | sway/handlers.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 2235bc8b..24784330 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include "sway/criteria.h" | 21 | #include "sway/criteria.h" |
22 | #include "sway/ipc-server.h" | 22 | #include "sway/ipc-server.h" |
23 | #include "sway/input.h" | 23 | #include "sway/input.h" |
24 | #include "sway/security.h" | ||
24 | #include "list.h" | 25 | #include "list.h" |
25 | #include "stringop.h" | 26 | #include "stringop.h" |
26 | #include "log.h" | 27 | #include "log.h" |
@@ -516,8 +517,13 @@ static void handle_view_geometry_request(wlc_handle handle, const struct wlc_geo | |||
516 | 517 | ||
517 | static void handle_view_state_request(wlc_handle view, enum wlc_view_state_bit state, bool toggle) { | 518 | static void handle_view_state_request(wlc_handle view, enum wlc_view_state_bit state, bool toggle) { |
518 | swayc_t *c = swayc_by_handle(view); | 519 | swayc_t *c = swayc_by_handle(view); |
520 | pid_t pid = wlc_view_get_pid(view); | ||
519 | switch (state) { | 521 | switch (state) { |
520 | case WLC_BIT_FULLSCREEN: | 522 | case WLC_BIT_FULLSCREEN: |
523 | if (!(get_feature_policy(pid) & FEATURE_FULLSCREEN)) { | ||
524 | sway_log(L_INFO, "Denying fullscreen to %d (%s)", pid, c->name); | ||
525 | break; | ||
526 | } | ||
521 | // i3 just lets it become fullscreen | 527 | // i3 just lets it become fullscreen |
522 | wlc_view_set_state(view, state, toggle); | 528 | wlc_view_set_state(view, state, toggle); |
523 | if (c) { | 529 | if (c) { |