commit ec9c4de564286d3795dd204e2c0a69b10f7572be
parent d4e80cf301d77f69370cc81657c433990986cfa6
Author: Ryan Dwyer <ryandwyer1@gmail.com>
Date: Tue, 11 Sep 2018 17:17:19 +1000
Introduce tiling_drag directive
Diffstat:
6 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/include/sway/commands.h b/include/sway/commands.h
@@ -161,6 +161,7 @@ sway_cmd cmd_sticky;
sway_cmd cmd_swaybg_command;
sway_cmd cmd_swaynag_command;
sway_cmd cmd_swap;
+sway_cmd cmd_tiling_drag;
sway_cmd cmd_title_format;
sway_cmd cmd_unmark;
sway_cmd cmd_urgent;
diff --git a/include/sway/config.h b/include/sway/config.h
@@ -365,6 +365,7 @@ struct sway_config {
bool validating;
bool auto_back_and_forth;
bool show_marks;
+ bool tiling_drag;
bool edge_gaps;
bool smart_gaps;
diff --git a/sway/commands.c b/sway/commands.c
@@ -127,6 +127,7 @@ static struct cmd_handler handlers[] = {
{ "set", cmd_set },
{ "show_marks", cmd_show_marks },
{ "smart_gaps", cmd_smart_gaps },
+ { "tiling_drag", cmd_tiling_drag },
{ "workspace", cmd_workspace },
{ "workspace_auto_back_and_forth", cmd_ws_auto_back_and_forth },
};
diff --git a/sway/commands/tiling_drag.c b/sway/commands/tiling_drag.c
@@ -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);
+}
diff --git a/sway/config.c b/sway/config.c
@@ -225,6 +225,7 @@ static void config_defaults(struct sway_config *config) {
config->auto_back_and_forth = false;
config->reading = false;
config->show_marks = true;
+ config->tiling_drag = true;
config->edge_gaps = true;
config->smart_gaps = false;
diff --git a/sway/meson.build b/sway/meson.build
@@ -83,6 +83,7 @@ sway_sources = files(
'commands/swaybg_command.c',
'commands/swaynag_command.c',
'commands/swap.c',
+ 'commands/tiling_drag.c',
'commands/title_format.c',
'commands/unmark.c',
'commands/urgent.c',