config: add tablet output mapping configuration

Also add missing default for 'tablet.rotation'.
This commit is contained in:
Jens Peters 2024-01-07 22:19:05 +01:00 committed by Johan Malm
parent 58ee4b7e07
commit 1df3ada636
2 changed files with 7 additions and 0 deletions

View file

@ -90,6 +90,7 @@ struct rcxml {
/* graphics tablet */
struct tablet_config {
char *output_name;
struct wlr_fbox box;
enum rotation rotation;
uint16_t button_map_count;

View file

@ -863,6 +863,8 @@ entry(xmlNode *node, char *nodename, char *content)
} else {
wlr_log(WLR_ERROR, "Invalid value for <resize popupShow />");
}
} else if (!strcasecmp(nodename, "mapToOutput.tablet")) {
rc.tablet.output_name = xstrdup(content);
} else if (!strcasecmp(nodename, "rotate.tablet")) {
rc.tablet.rotation = tablet_parse_rotation(atoi(content));
} else if (!strcasecmp(nodename, "left.area.tablet")) {
@ -1044,6 +1046,8 @@ rcxml_init(void)
rc.doubleclick_time = 500;
rc.scroll_factor = 1.0;
rc.tablet.output_name = NULL;
rc.tablet.rotation = 0;
rc.tablet.box = (struct wlr_fbox){0};
tablet_load_default_button_mappings();
@ -1559,6 +1563,8 @@ rcxml_finish(void)
zfree(m);
}
zfree(rc.tablet.output_name);
struct libinput_category *l, *l_tmp;
wl_list_for_each_safe(l, l_tmp, &rc.libinput_categories, link) {
wl_list_remove(&l->link);