mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
backend/session: Remove noop backend
This is instead delegated to libseat.
This commit is contained in:
parent
d037c2dddc
commit
3f87c2caea
3 changed files with 0 additions and 55 deletions
|
@ -5,7 +5,6 @@ libseat = dependency('libseat',
|
||||||
)
|
)
|
||||||
|
|
||||||
wlr_files += files(
|
wlr_files += files(
|
||||||
'noop.c',
|
|
||||||
'session.c',
|
'session.c',
|
||||||
'libseat.c'
|
'libseat.c'
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
#define _POSIX_C_SOURCE 200809L
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <wayland-server-core.h>
|
|
||||||
#include <wlr/backend/session/interface.h>
|
|
||||||
#include <wlr/util/log.h>
|
|
||||||
#include "backend/session/session.h"
|
|
||||||
#include "util/signal.h"
|
|
||||||
|
|
||||||
const struct session_impl session_noop;
|
|
||||||
|
|
||||||
static int noop_session_open(struct wlr_session *base, const char *path) {
|
|
||||||
return open(path, O_RDWR | O_CLOEXEC);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void noop_session_close(struct wlr_session *base, int fd) {
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool noop_change_vt(struct wlr_session *base, unsigned vt) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void noop_session_destroy(struct wlr_session *base) {
|
|
||||||
free(base);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct wlr_session *noop_session_create(struct wl_display *disp) {
|
|
||||||
struct wlr_session *session = calloc(1, sizeof(*session));
|
|
||||||
if (!session) {
|
|
||||||
wlr_log_errno(WLR_ERROR, "Allocation failed");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
session_init(session);
|
|
||||||
session->impl = &session_noop;
|
|
||||||
session->active = true;
|
|
||||||
|
|
||||||
wlr_log(WLR_INFO, "Successfully initialized noop session");
|
|
||||||
return session;
|
|
||||||
}
|
|
||||||
|
|
||||||
const struct session_impl session_noop = {
|
|
||||||
.create = noop_session_create,
|
|
||||||
.destroy = noop_session_destroy,
|
|
||||||
.open = noop_session_open,
|
|
||||||
.close = noop_session_close,
|
|
||||||
.change_vt = noop_change_vt,
|
|
||||||
};
|
|
|
@ -21,7 +21,6 @@
|
||||||
#define WAIT_GPU_TIMEOUT 10000 // ms
|
#define WAIT_GPU_TIMEOUT 10000 // ms
|
||||||
|
|
||||||
extern const struct session_impl session_libseat;
|
extern const struct session_impl session_libseat;
|
||||||
extern const struct session_impl session_noop;
|
|
||||||
|
|
||||||
static const struct session_impl *const impls[] = {
|
static const struct session_impl *const impls[] = {
|
||||||
&session_libseat,
|
&session_libseat,
|
||||||
|
@ -109,8 +108,6 @@ struct wlr_session *wlr_session_create(struct wl_display *disp) {
|
||||||
if (env_wlr_session) {
|
if (env_wlr_session) {
|
||||||
if (strcmp(env_wlr_session, "libseat") == 0) {
|
if (strcmp(env_wlr_session, "libseat") == 0) {
|
||||||
session = session_libseat.create(disp);
|
session = session_libseat.create(disp);
|
||||||
} else if (strcmp(env_wlr_session, "noop") == 0) {
|
|
||||||
session = session_noop.create(disp);
|
|
||||||
} else {
|
} else {
|
||||||
wlr_log(WLR_ERROR, "Unsupported WLR_SESSION: %s",
|
wlr_log(WLR_ERROR, "Unsupported WLR_SESSION: %s",
|
||||||
env_wlr_session);
|
env_wlr_session);
|
||||||
|
|
Loading…
Reference in a new issue