Merge branch 'optional_udev' into 'master'

[RFC] backend/session, backend/libinput: make udev optional

Closes #2257

See merge request wlroots/wlroots!3490
This commit is contained in:
illiliti 2022-05-28 17:24:48 +00:00
commit 50a5efbdc0
15 changed files with 627 additions and 258 deletions

View file

@ -0,0 +1,16 @@
#include <stdbool.h>
#include <sys/types.h>
#include <wlr/backend/session.h>
#include <wayland-server-core.h>
#ifndef BACKEND_SESSION_DEV_H
#define BACKEND_SESSION_DEV_H
int dev_init(struct wlr_session *session, struct wl_display *display);
void dev_finish(struct wlr_session *session);
ssize_t dev_find_gpus(struct wlr_session *session, size_t ret_len,
struct wlr_device **ret);
bool is_drm_card(const char *devname);
#endif

View file

@ -0,0 +1,11 @@
#include <wayland-server-core.h>
#ifndef BACKEND_SESSION_DEV_DEMI_H
#define BACKEND_SESSION_DEV_DEMI_H
struct dev {
int fd;
struct wl_event_source *event;
};
#endif

View file

@ -0,0 +1,13 @@
#include <libudev.h>
#include <wayland-server-core.h>
#ifndef BACKEND_SESSION_DEV_UDEV_H
#define BACKEND_SESSION_DEV_UDEV_H
struct dev {
struct udev *udev;
struct udev_monitor *mon;
struct wl_event_source *udev_event;
};
#endif

View file

@ -1,17 +1,18 @@
#ifndef WLR_BACKEND_SESSION_H
#define WLR_BACKEND_SESSION_H
#include <libudev.h>
#include <stdbool.h>
#include <sys/types.h>
#include <wayland-server-core.h>
struct libseat;
struct dev;
struct wlr_device {
int fd;
int device_id;
dev_t dev;
char *devnode;
struct wl_list link;
struct {
@ -34,9 +35,7 @@ struct wlr_session {
unsigned vtnr;
char seat[256];
struct udev *udev;
struct udev_monitor *mon;
struct wl_event_source *udev_event;
struct dev *dev;
struct libseat *seat_handle;
struct wl_event_source *libseat_event;

View file

@ -11,4 +11,7 @@
#mesondefine WLR_HAS_XWAYLAND
#mesondefine WLR_HAS_UDEV
#mesondefine WLR_HAS_DEMI
#endif