From 7f54495b5e62a65627cdb61f099e241f0594a6d9 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Fri, 1 Nov 2019 11:37:29 -0600 Subject: Use an enum instead of a marker string for map_to_ --- sway/commands/input/map_to_output.c | 1 + sway/commands/input/map_to_region.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'sway/commands') diff --git a/sway/commands/input/map_to_output.c b/sway/commands/input/map_to_output.c index 6d623186..f60fb7d5 100644 --- a/sway/commands/input/map_to_output.c +++ b/sway/commands/input/map_to_output.c @@ -16,6 +16,7 @@ struct cmd_results *input_cmd_map_to_output(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "No input device defined."); } + ic->mapped_to = MAPPED_TO_OUTPUT; ic->mapped_to_output = strdup(argv[0]); return cmd_results_new(CMD_SUCCESS, NULL); diff --git a/sway/commands/input/map_to_region.c b/sway/commands/input/map_to_region.c index e0b69ed5..e85495e5 100644 --- a/sway/commands/input/map_to_region.c +++ b/sway/commands/input/map_to_region.c @@ -15,9 +15,7 @@ struct cmd_results *input_cmd_map_to_region(int argc, char **argv) { return cmd_results_new(CMD_FAILURE, "No input device defined"); } - // This is used to clear the current output mapping. - ic->mapped_to_output = strdup(""); - + ic->mapped_to = MAPPED_TO_REGION; ic->mapped_to_region = calloc(1, sizeof(struct wlr_box)); const char *errstr; -- cgit v1.2.3-54-g00ecf