From 1df3ada636f3ddb7fae4267ba6e701d2a0c72105 Mon Sep 17 00:00:00 2001 From: Jens Peters Date: Sun, 7 Jan 2024 22:19:05 +0100 Subject: [PATCH] config: add tablet output mapping configuration Also add missing default for 'tablet.rotation'. --- include/config/rcxml.h | 1 + src/config/rcxml.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 27a342da..b545f31a 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -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; diff --git a/src/config/rcxml.c b/src/config/rcxml.c index 81f72c3c..2028556e 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -863,6 +863,8 @@ entry(xmlNode *node, char *nodename, char *content) } else { wlr_log(WLR_ERROR, "Invalid value for "); } + } 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);