aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/popup_during_fullscreen.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-07 20:40:05 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-08 22:49:59 +1000
commit832ebc896655cb5ca7689559d4e42b426d764e71 (patch)
tree1a3bc3ff7fb13d7ed5e86ad67a05739d4c4a1de3 /sway/commands/popup_during_fullscreen.c
parentMerge pull request #2791 from RyanDwyer/status-command-optional (diff)
downloadsway-832ebc896655cb5ca7689559d4e42b426d764e71.tar.gz
sway-832ebc896655cb5ca7689559d4e42b426d764e71.tar.zst
sway-832ebc896655cb5ca7689559d4e42b426d764e71.zip
Implement popup_during_fullscreen
This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view.
Diffstat (limited to 'sway/commands/popup_during_fullscreen.c')
-rw-r--r--sway/commands/popup_during_fullscreen.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sway/commands/popup_during_fullscreen.c b/sway/commands/popup_during_fullscreen.c
new file mode 100644
index 00000000..da1904b6
--- /dev/null
+++ b/sway/commands/popup_during_fullscreen.c
@@ -0,0 +1,25 @@
1#include <strings.h>
2#include "sway/commands.h"
3#include "sway/config.h"
4
5struct cmd_results *cmd_popup_during_fullscreen(int argc, char **argv) {
6 struct cmd_results *error = NULL;
7 if ((error = checkarg(argc, "popup_during_fullscreen",
8 EXPECTED_EQUAL_TO, 1))) {
9 return error;
10 }
11
12 if (strcasecmp(argv[0], "smart") == 0) {
13 config->popup_during_fullscreen = POPUP_SMART;
14 } else if (strcasecmp(argv[0], "ignore") == 0) {
15 config->popup_during_fullscreen = POPUP_IGNORE;
16 } else if (strcasecmp(argv[0], "leave_fullscreen") == 0) {
17 config->popup_during_fullscreen = POPUP_LEAVE;
18 } else {
19 return cmd_results_new(CMD_INVALID, "popup_during_fullscreen",
20 "Expected "
21 "'popup_during_fullscreen smart|ignore|leave_fullscreen'");
22 }
23
24 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
25}