aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/events.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-29 12:15:54 +0100
committeremersion <contact@emersion.fr>2018-04-29 14:30:09 +0100
commit2551ef8871d78a43acbbbac765919ea4f48821f9 (patch)
treeacc9861ab6d5dde94999924fdbd58a19eba6e2a3 /backend/libinput/events.c
parenta0f490306395ac3705c00ecc85b4a0bba721886e (diff)
input-device: add output_name field, populate it from libinput
Diffstat (limited to 'backend/libinput/events.c')
-rw-r--r--backend/libinput/events.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index ace21a89..2e4b7f84 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -1,3 +1,4 @@
+#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <libinput.h>
#include <stdlib.h>
@@ -48,6 +49,10 @@ static struct wlr_input_device *allocate_device(
struct wlr_input_device *wlr_dev = &wlr_libinput_dev->wlr_input_device;
libinput_device_get_size(libinput_dev,
&wlr_dev->width_mm, &wlr_dev->height_mm);
+ const char *output_name = libinput_device_get_output_name(libinput_dev);
+ if (output_name != NULL) {
+ wlr_dev->output_name = strdup(output_name);
+ }
wl_list_insert(wlr_devices, &wlr_dev->link);
wlr_libinput_dev->handle = libinput_dev;
libinput_device_ref(libinput_dev);