]> git.mdlowis.com Git - proto/labwc.git/commitdiff
seat: get output name from touch config for current device
authorJens Peters <jp7677@gmail.com>
Fri, 19 Jan 2024 09:10:02 +0000 (10:10 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 22 Jan 2024 21:50:18 +0000 (21:50 +0000)
The output name attached to the touch device has
still priority.

src/seat.c

index b0cb3855d83d7145a3a610ac4dbec548ae889d90..c0385108e1c3f677b96ae9b8c6d348088ade1f06 100644 (file)
@@ -273,7 +273,15 @@ static void
 map_touch_to_output(struct seat *seat, struct wlr_input_device *dev)
 {
        struct wlr_touch *touch = wlr_touch_from_input_device(dev);
-       char *output_name = touch->output_name ? touch->output_name : NULL;
+
+       char *touch_config_output_name = NULL;
+       struct touch_config_entry *config_entry =
+               touch_find_config_for_device(touch->base.name);
+       if (config_entry) {
+               touch_config_output_name = config_entry->output_name;
+       }
+
+       char *output_name = touch->output_name ? touch->output_name : touch_config_output_name;
        wlr_log(WLR_INFO, "map touch to output %s\n", output_name);
        map_input_to_output(seat, dev, output_name);
 }