mirror of
https://github.com/swaywm/sway.git
synced 2024-11-21 23:41:27 +00:00
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
This commit is contained in:
parent
b6e3045d32
commit
a8cb63e3a4
|
@ -67,6 +67,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
// Set current mode
|
// Set current mode
|
||||||
|
struct sway_mode *stored_mode = config->current_mode;
|
||||||
config->current_mode = mode;
|
config->current_mode = mode;
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
// trigger IPC mode event
|
// trigger IPC mode event
|
||||||
|
@ -80,7 +81,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
|
||||||
// Create binding
|
// Create binding
|
||||||
struct cmd_results *result = config_subcommand(argv + 1, argc - 1,
|
struct cmd_results *result = config_subcommand(argv + 1, argc - 1,
|
||||||
mode_handlers, sizeof(mode_handlers));
|
mode_handlers, sizeof(mode_handlers));
|
||||||
config->current_mode = config->modes->items[0];
|
config->current_mode = stored_mode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue