mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-13 14:32:57 -04:00
backend/session: wire up openbsd support
This commit is contained in:
parent
326bd749ee
commit
f56f21b98f
2 changed files with 57 additions and 7 deletions
|
|
@ -1,18 +1,27 @@
|
|||
msg = 'Required for session support.'
|
||||
udev = dependency('libudev', required: session_required, not_found_message: msg)
|
||||
libseat = dependency(
|
||||
'libseat',
|
||||
version: '>=0.2.0',
|
||||
fallback: 'seatd',
|
||||
default_options: ['server=disabled', 'man-pages=disabled', 'examples=disabled'],
|
||||
required: session_required,
|
||||
not_found_message: msg,
|
||||
)
|
||||
if not (udev.found() and libseat.found())
|
||||
subdir_done()
|
||||
|
||||
platform = target_machine.system()
|
||||
if platform == 'linux' or platform == 'freebsd'
|
||||
libudev = dependency('libudev', required: session_required)
|
||||
if not (libudev.found() and libseat.found())
|
||||
subdir_done()
|
||||
endif
|
||||
|
||||
wlr_files += files('session_libudev.c')
|
||||
wlr_deps += libudev
|
||||
elif platform == 'openbsd'
|
||||
wlr_files += files('session_openbsd.c')
|
||||
else
|
||||
error('Unsupported platform')
|
||||
endif
|
||||
|
||||
wlr_files += files('session.c')
|
||||
wlr_files += files('session_libudev.c')
|
||||
wlr_deps += [udev, libseat]
|
||||
wlr_deps += libseat
|
||||
features += { 'session': true }
|
||||
|
||||
|
|
|
|||
41
backend/session/session_openbsd.c
Normal file
41
backend/session/session_openbsd.c
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include "backend/session/session.h"
|
||||
|
||||
struct drm_event_monitor {
|
||||
int fd;
|
||||
};
|
||||
|
||||
// TODO: use kqueue NOTE_CHANGE mechanism
|
||||
struct drm_event_monitor *monitor_drm_events(int *fd) {
|
||||
struct drm_event_monitor *ctx = calloc(1, sizeof(struct drm_event_monitor));
|
||||
if (!ctx) {
|
||||
return NULL;
|
||||
}
|
||||
ctx->fd = open("/dev/null", O_RDONLY);
|
||||
if (ctx->fd == -1) {
|
||||
free(ctx);
|
||||
return NULL;
|
||||
}
|
||||
*fd = ctx->fd;
|
||||
return ctx;
|
||||
}
|
||||
void drm_event_monitor_free(struct drm_event_monitor *ctx) {
|
||||
close(ctx->fd);
|
||||
free(ctx);
|
||||
}
|
||||
|
||||
int receive_drm_device(struct drm_event_monitor *ctx,
|
||||
struct drm_event_content *ev) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const char *get_device_seat(struct drm_event_monitor *ctx, const char *devnode) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool is_drm_device_primary(struct drm_event_monitor *ctx, const char *devnode) {
|
||||
return false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue