mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-10 13:29:44 -05:00
input-device: add output_name field, populate it from libinput
This commit is contained in:
parent
a0f4903063
commit
2551ef8871
3 changed files with 9 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue