mirror of
https://github.com/NickHu/sway
synced 2024-12-29 22:23:46 +01:00
2a684cad5f
Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
24 lines
763 B
C
24 lines
763 B
C
#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, "Expected "
|
|
"'popup_during_fullscreen smart|ignore|leave_fullscreen'");
|
|
}
|
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
|
}
|