Introduce tiling_drag directive

This commit is contained in:
Ryan Dwyer 2018-09-11 17:17:19 +10:00
parent d4e80cf301
commit ec9c4de564
6 changed files with 18 additions and 0 deletions

View file

@ -161,6 +161,7 @@ sway_cmd cmd_sticky;
sway_cmd cmd_swaybg_command; sway_cmd cmd_swaybg_command;
sway_cmd cmd_swaynag_command; sway_cmd cmd_swaynag_command;
sway_cmd cmd_swap; sway_cmd cmd_swap;
sway_cmd cmd_tiling_drag;
sway_cmd cmd_title_format; sway_cmd cmd_title_format;
sway_cmd cmd_unmark; sway_cmd cmd_unmark;
sway_cmd cmd_urgent; sway_cmd cmd_urgent;

View file

@ -365,6 +365,7 @@ struct sway_config {
bool validating; bool validating;
bool auto_back_and_forth; bool auto_back_and_forth;
bool show_marks; bool show_marks;
bool tiling_drag;
bool edge_gaps; bool edge_gaps;
bool smart_gaps; bool smart_gaps;

View file

@ -127,6 +127,7 @@ static struct cmd_handler handlers[] = {
{ "set", cmd_set }, { "set", cmd_set },
{ "show_marks", cmd_show_marks }, { "show_marks", cmd_show_marks },
{ "smart_gaps", cmd_smart_gaps }, { "smart_gaps", cmd_smart_gaps },
{ "tiling_drag", cmd_tiling_drag },
{ "workspace", cmd_workspace }, { "workspace", cmd_workspace },
{ "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth }, { "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth },
}; };

View file

@ -0,0 +1,13 @@
#include "sway/commands.h"
#include "util.h"
struct cmd_results *cmd_tiling_drag(int argc, char **argv) {
struct cmd_results *error = NULL;
if ((error = checkarg(argc, "tiling_drag", EXPECTED_EQUAL_TO, 1))) {
return error;
}
config->tiling_drag = parse_boolean(argv[0], config->tiling_drag);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}

View file

@ -225,6 +225,7 @@ static void config_defaults(struct sway_config *config) {
config->auto_back_and_forth = false; config->auto_back_and_forth = false;
config->reading = false; config->reading = false;
config->show_marks = true; config->show_marks = true;
config->tiling_drag = true;
config->edge_gaps = true; config->edge_gaps = true;
config->smart_gaps = false; config->smart_gaps = false;

View file

@ -83,6 +83,7 @@ sway_sources = files(
'commands/swaybg_command.c', 'commands/swaybg_command.c',
'commands/swaynag_command.c', 'commands/swaynag_command.c',
'commands/swap.c', 'commands/swap.c',
'commands/tiling_drag.c',
'commands/title_format.c', 'commands/title_format.c',
'commands/unmark.c', 'commands/unmark.c',
'commands/urgent.c', 'commands/urgent.c',