mirror of
https://github.com/swaywm/sway.git
synced 2025-11-07 13:29:56 -05:00
Implement focus_on_window_activation
Depends on https://github.com/swaywm/wlroots/pull/1223
This commit is contained in:
parent
159edc6d13
commit
f057a0195e
8 changed files with 86 additions and 0 deletions
25
sway/commands/focus_on_window_activation.c
Normal file
25
sway/commands/focus_on_window_activation.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "sway/commands.h"
|
||||
|
||||
struct cmd_results *cmd_focus_on_window_activation(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
if ((error = checkarg(argc, "focus_on_window_activation",
|
||||
EXPECTED_EQUAL_TO, 1))) {
|
||||
return error;
|
||||
}
|
||||
|
||||
if (strcmp(argv[0], "smart") == 0) {
|
||||
config->focus_on_window_activation = FOWA_SMART;
|
||||
} else if (strcmp(argv[0], "urgent") == 0) {
|
||||
config->focus_on_window_activation = FOWA_URGENT;
|
||||
} else if (strcmp(argv[0], "focus") == 0) {
|
||||
config->focus_on_window_activation = FOWA_FOCUS;
|
||||
} else if (strcmp(argv[0], "none") == 0) {
|
||||
config->focus_on_window_activation = FOWA_NONE;
|
||||
} else {
|
||||
return cmd_results_new(CMD_INVALID, "focus_on_window_activation",
|
||||
"Expected "
|
||||
"'focus_on_window_activation smart|urgent|focus|none'");
|
||||
}
|
||||
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue