diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-09-23 19:56:52 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-09-23 19:56:52 -0400 |
commit | baeb28ea6230ef9aa409ee52abe208720120e45c (patch) | |
tree | d5a6fffc3470b3fbbb18a6ae01851451bea1dbb2 /sway/commands/input/xkb_model.c | |
parent | Merge pull request #2699 from RedSoxFan/fix-2667 (diff) | |
download | sway-baeb28ea6230ef9aa409ee52abe208720120e45c.tar.gz sway-baeb28ea6230ef9aa409ee52abe208720120e45c.tar.zst sway-baeb28ea6230ef9aa409ee52abe208720120e45c.zip |
Implement support for input wildcard
Diffstat (limited to 'sway/commands/input/xkb_model.c')
-rw-r--r-- | sway/commands/input/xkb_model.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sway/commands/input/xkb_model.c b/sway/commands/input/xkb_model.c index 0d082625..c4d04638 100644 --- a/sway/commands/input/xkb_model.c +++ b/sway/commands/input/xkb_model.c | |||
@@ -9,18 +9,15 @@ struct cmd_results *input_cmd_xkb_model(int argc, char **argv) { | |||
9 | if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) { | 9 | if ((error = checkarg(argc, "xkb_model", EXPECTED_EQUAL_TO, 1))) { |
10 | return error; | 10 | return error; |
11 | } | 11 | } |
12 | struct input_config *current_input_config = | 12 | struct input_config *ic = config->handler_context.input_config; |
13 | config->handler_context.input_config; | 13 | if (!ic) { |
14 | if (!current_input_config) { | 14 | return cmd_results_new(CMD_FAILURE, "xkb_model", |
15 | return cmd_results_new(CMD_FAILURE, "xkb_model", "No input device defined."); | 15 | "No input device defined."); |
16 | } | 16 | } |
17 | struct input_config *new_config = | ||
18 | new_input_config(current_input_config->identifier); | ||
19 | 17 | ||
20 | new_config->xkb_model = strdup(argv[0]); | 18 | ic->xkb_model = strdup(argv[0]); |
21 | 19 | ||
22 | wlr_log(WLR_DEBUG, "apply-xkb_model for device: %s model: %s", | 20 | wlr_log(WLR_DEBUG, "set-xkb_model for config: %s model: %s", |
23 | current_input_config->identifier, new_config->xkb_model); | 21 | ic->identifier, ic->xkb_model); |
24 | apply_input_config(new_config); | ||
25 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 22 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
26 | } | 23 | } |