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.
26 lines
683 B
C
26 lines
683 B
C
#include "sway/commands.h"
|
|
#include "sway/config.h"
|
|
#include "sway/tree/arrange.h"
|
|
#include "sway/tree/view.h"
|
|
#include "util.h"
|
|
|
|
struct cmd_results *cmd_smart_borders(int argc, char **argv) {
|
|
struct cmd_results *error = NULL;
|
|
if ((error = checkarg(argc, "smart_borders", EXPECTED_EQUAL_TO, 1))) {
|
|
return error;
|
|
}
|
|
|
|
enum edge_border_types saved = config->hide_edge_borders;
|
|
if (strcmp(argv[0], "no_gaps") == 0) {
|
|
config->hide_edge_borders = E_SMART_NO_GAPS;
|
|
} else {
|
|
config->hide_edge_borders = parse_boolean(argv[0], true) ?
|
|
E_SMART : config->saved_edge_borders;
|
|
}
|
|
config->saved_edge_borders = saved;
|
|
|
|
arrange_root();
|
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
|
}
|