From 265d8782c92a89d7f4884c98650a57f9c91a48ec Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 28 Oct 2022 21:10:19 +0900 Subject: [PATCH] virtual pointer: set output name from preferred output This fixes the following error when trying to map outputs: 00:00:03.384 [../seat.c:126] Input device virtual pointer cannot be mapped to an output device (this is probably harmless) --- seat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/seat.c b/seat.c index 59f8c16..c87ac98 100644 --- a/seat.c +++ b/seat.c @@ -6,11 +6,14 @@ * See the LICENSE file accompanying this file. */ +#define _XOPEN_SOURCE 500 + #include "config.h" #include #include #include +#include #include #include #include @@ -216,6 +219,11 @@ handle_virtual_pointer(struct wl_listener *listener, void *data) struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; struct wlr_input_device *device = &pointer->input_device; + /* We'll want to map the device back to an output later, this is a bit + * sub-optimal (we could just keep the suggested_output), but just copy + * its name so we do like other devices + */ + device->output_name = strdup(event->suggested_output->name); /* event->suggested_seat should be checked if we handle multiple seats */ handle_new_pointer(seat, device); }