2018-10-02 02:56:27 +10:00
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(argv[0], "no_gaps") == 0) {
|
2019-11-05 09:10:40 +11:00
|
|
|
config->hide_edge_borders_smart = ESMART_NO_GAPS;
|
2018-10-02 02:56:27 +10:00
|
|
|
} else {
|
2019-11-05 09:10:40 +11:00
|
|
|
config->hide_edge_borders_smart = parse_boolean(argv[0], true) ?
|
|
|
|
ESMART_ON : ESMART_OFF;
|
2018-10-02 02:56:27 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
arrange_root();
|
|
|
|
|
2019-01-11 10:27:21 +11:00
|
|
|
return cmd_results_new(CMD_SUCCESS, NULL);
|
2018-10-02 02:56:27 +10:00
|
|
|
}
|