mirror of
https://github.com/swaywm/sway.git
synced 2025-11-08 13:29:50 -05:00
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.
This commit is contained in:
parent
6cb0e58c6d
commit
832ebc8966
16 changed files with 192 additions and 2 deletions
25
sway/commands/popup_during_fullscreen.c
Normal file
25
sway/commands/popup_during_fullscreen.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <strings.h>
|
||||
#include "sway/commands.h"
|
||||
#include "sway/config.h"
|
||||
|
||||
struct cmd_results *cmd_popup_during_fullscreen(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "popup_during_fullscreen",
|
||||
EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
if (strcasecmp(argv[0], "smart") == 0) {
|
||||
config->popup_during_fullscreen = POPUP_SMART;
|
||||
} else if (strcasecmp(argv[0], "ignore") == 0) {
|
||||
config->popup_during_fullscreen = POPUP_IGNORE;
|
||||
} else if (strcasecmp(argv[0], "leave_fullscreen") == 0) {
|
||||
config->popup_during_fullscreen = POPUP_LEAVE;
|
||||
} else {
|
||||
return cmd_results_new(CMD_INVALID, "popup_during_fullscreen",
|
||||
"Expected "
|
||||
"'popup_during_fullscreen smart|ignore|leave_fullscreen'");
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue