diff options
Diffstat (limited to 'sway/commands/input/scroll_factor.c')
-rw-r--r-- | sway/commands/input/scroll_factor.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/commands/input/scroll_factor.c b/sway/commands/input/scroll_factor.c index 52d943b0..4b72b6fa 100644 --- a/sway/commands/input/scroll_factor.c +++ b/sway/commands/input/scroll_factor.c | |||
@@ -14,19 +14,18 @@ struct cmd_results *input_cmd_scroll_factor(int argc, char **argv) { | |||
14 | } | 14 | } |
15 | struct input_config *ic = config->handler_context.input_config; | 15 | struct input_config *ic = config->handler_context.input_config; |
16 | if (!ic) { | 16 | if (!ic) { |
17 | return cmd_results_new(CMD_FAILURE, | 17 | return cmd_results_new(CMD_FAILURE, "No input device defined."); |
18 | "scroll_factor", "No input device defined."); | ||
19 | } | 18 | } |
20 | 19 | ||
21 | float scroll_factor = parse_float(argv[0]); | 20 | float scroll_factor = parse_float(argv[0]); |
22 | if (isnan(scroll_factor)) { | 21 | if (isnan(scroll_factor)) { |
23 | return cmd_results_new(CMD_INVALID, "scroll_factor", | 22 | return cmd_results_new(CMD_INVALID, |
24 | "Invalid scroll factor; expected float."); | 23 | "Invalid scroll factor; expected float."); |
25 | } else if (scroll_factor < 0) { | 24 | } else if (scroll_factor < 0) { |
26 | return cmd_results_new(CMD_INVALID, "scroll_factor", | 25 | return cmd_results_new(CMD_INVALID, |
27 | "Scroll factor cannot be negative."); | 26 | "Scroll factor cannot be negative."); |
28 | } | 27 | } |
29 | ic->scroll_factor = scroll_factor; | 28 | ic->scroll_factor = scroll_factor; |
30 | 29 | ||
31 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 30 | return cmd_results_new(CMD_SUCCESS, NULL); |
32 | } | 31 | } |