aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/mode.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-23 20:27:56 -0400
committerDrew DeVault <sir@cmpwn.com>2018-07-23 20:31:11 -0400
commitf4b882475eee7a81c206c7825616cc4656b2f60b (patch)
tree38e6ebf81b235424f105dcbcbb194e5e9eac70c0 /sway/commands/mode.c
parentacd79e1505c06089e4fb9fb6c0c6e1d351ba9176 (diff)
parent224ade138208e9aa525423cbfbd643aa9d9b63c3 (diff)
downloadsway-f4b882475eee7a81c206c7825616cc4656b2f60b.tar.xz
Merge branch 'master' into pid-workspaces
Diffstat (limited to 'sway/commands/mode.c')
-rw-r--r--sway/commands/mode.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sway/commands/mode.c b/sway/commands/mode.c
index 00331ccc..b460fcb5 100644
--- a/sway/commands/mode.c
+++ b/sway/commands/mode.c
@@ -26,7 +26,17 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
"mode", "Can only be used in config file.");
}
- const char *mode_name = argv[0];
+ bool pango = strcmp(*argv, "--pango_markup") == 0;
+ if (pango) {
+ argc--; argv++;
+ if (argc == 0) {
+ return cmd_results_new(CMD_FAILURE, "mode",
+ "Mode name is missing");
+ }
+ }
+
+ char *mode_name = *argv;
+ strip_quotes(mode_name);
struct sway_mode *mode = NULL;
// Find mode
for (int i = 0; i < config->modes->length; ++i) {
@@ -46,6 +56,7 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
mode->name = strdup(mode_name);
mode->keysym_bindings = create_list();
mode->keycode_bindings = create_list();
+ mode->pango = pango;
list_add(config->modes, mode);
}
if (!mode) {
@@ -54,13 +65,15 @@ struct cmd_results *cmd_mode(int argc, char **argv) {
return error;
}
if ((config->reading && argc > 1) || (!config->reading && argc == 1)) {
- wlr_log(L_DEBUG, "Switching to mode `%s'",mode->name);
+ wlr_log(WLR_DEBUG, "Switching to mode `%s' (pango=%d)",
+ mode->name, mode->pango);
}
// Set current mode
config->current_mode = mode;
if (argc == 1) {
// trigger IPC mode event
- ipc_event_mode(config->current_mode->name);
+ ipc_event_mode(config->current_mode->name,
+ config->current_mode->pango);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}