aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/mode.c
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-08-26 22:58:01 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-08-27 13:45:04 +0900
commit1a8b9fda8a81d71ec9de65fd4c3f1df40e03f971 (patch)
treedf835cdc519695155067dba5b70b8aca24148d15 /sway/commands/mode.c
parentchmod +x contrib/_incr_version (diff)
downloadsway-1a8b9fda8a81d71ec9de65fd4c3f1df40e03f971.tar.gz
sway-1a8b9fda8a81d71ec9de65fd4c3f1df40e03f971.tar.zst
sway-1a8b9fda8a81d71ec9de65fd4c3f1df40e03f971.zip
cmd_mode: don't reset to default after subcommand
In cmd_mode, the mode is currently being reset to the default mode after a mode subcommand handler is executed. This stores and restores the mode instead
Diffstat (limited to 'sway/commands/mode.c')
-rw-r--r--sway/commands/mode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/commands/mode.c b/sway/commands/mode.c
index 9ddb0089..a5871dab 100644
--- a/sway/commands/mode.c
+++ b/sway/commands/mode.c
@@ -67,6 +67,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
67 return error; 67 return error;
68 } 68 }
69 // Set current mode 69 // Set current mode
70 struct sway_mode *stored_mode = config->current_mode;
70 config->current_mode = mode; 71 config->current_mode = mode;
71 if (argc == 1) { 72 if (argc == 1) {
72 // trigger IPC mode event 73 // trigger IPC mode event
@@ -80,7 +81,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
80 // Create binding 81 // Create binding
81 struct cmd_results *result = config_subcommand(argv + 1, argc - 1, 82 struct cmd_results *result = config_subcommand(argv + 1, argc - 1,
82 mode_handlers, sizeof(mode_handlers)); 83 mode_handlers, sizeof(mode_handlers));
83 config->current_mode = config->modes->items[0]; 84 config->current_mode = stored_mode;
84 85
85 return result; 86 return result;
86} 87}