Use an enum instead of a marker string for map_to_

This commit is contained in:
Tadeo Kondrak 2019-11-01 11:37:29 -06:00 committed by Simon Ser
parent 4829f1c26a
commit 7f54495b5e
5 changed files with 45 additions and 40 deletions

View file

@ -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);

View file

@ -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;