rootston: seat config by device

This commit is contained in:
Tony Crisci 2017-11-03 06:08:37 -04:00
parent 53021f8ed4
commit 447c561d15
2 changed files with 6 additions and 0 deletions

View file

@ -19,6 +19,7 @@ struct device_config {
char *name; char *name;
char *mapped_output; char *mapped_output;
struct wlr_box *mapped_box; struct wlr_box *mapped_box;
char *seat;
struct wl_list link; struct wl_list link;
}; };

View file

@ -289,6 +289,7 @@ static int config_ini_handler(void *user, const char *section, const char *name,
if (!found) { if (!found) {
dc = calloc(1, sizeof(struct device_config)); dc = calloc(1, sizeof(struct device_config));
dc->name = strdup(device_name); dc->name = strdup(device_name);
dc->seat = strdup("seat0");
wl_list_insert(&config->devices, &dc->link); wl_list_insert(&config->devices, &dc->link);
} }
@ -298,6 +299,9 @@ static int config_ini_handler(void *user, const char *section, const char *name,
} else if (strcmp(name, "geometry") == 0) { } else if (strcmp(name, "geometry") == 0) {
free(dc->mapped_box); free(dc->mapped_box);
dc->mapped_box = parse_geometry(value); dc->mapped_box = parse_geometry(value);
} else if (strcmp(name, "seat") == 0) {
free(dc->seat);
dc->seat = strdup(value);
} else { } else {
wlr_log(L_ERROR, "got unknown device config: %s", name); wlr_log(L_ERROR, "got unknown device config: %s", name);
} }
@ -387,6 +391,7 @@ void roots_config_destroy(struct roots_config *config) {
struct device_config *dc, *dtmp = NULL; struct device_config *dc, *dtmp = NULL;
wl_list_for_each_safe(dc, dtmp, &config->devices, link) { wl_list_for_each_safe(dc, dtmp, &config->devices, link) {
free(dc->name); free(dc->name);
free(dc->seat);
free(dc->mapped_output); free(dc->mapped_output);
free(dc->mapped_box); free(dc->mapped_box);
free(dc); free(dc);