]> git.mdlowis.com Git - proto/labwc.git/commitdiff
config: add tablet output mapping configuration
authorJens Peters <jp7677@gmail.com>
Sun, 7 Jan 2024 21:19:05 +0000 (22:19 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 10 Jan 2024 21:10:11 +0000 (21:10 +0000)
Also add missing default for 'tablet.rotation'.

include/config/rcxml.h
src/config/rcxml.c

index 27a342daf6f38460abb3c5e9651f6fa0f59be416..b545f31aef31d621f14d5687788b21f480c3cfd3 100644 (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;
index 81f72c3cac9ff5d973eded41682139a752ca12ac..2028556e29c1f5be738203fc5deca461cdb59dfd 100644 (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);