From 1b5537d53750a2b8dc11d42485caa0e19821e74f Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Sun, 5 Apr 2020 20:03:09 +0200 Subject: [PATCH] Restore logind as a default feature --- Cargo.toml | 2 +- anvil/Cargo.toml | 2 +- src/utils/signaling.rs | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 src/utils/signaling.rs diff --git a/Cargo.toml b/Cargo.toml index 7965426..3fc3101 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ slog-term = "2.3" gl_generator = { version = "0.10", optional = true } [features] -default = ["backend_winit", "backend_drm_legacy", "backend_drm_gbm", "backend_drm_egl", "backend_libinput", "backend_udev", "backend_session", "renderer_glium", "xwayland", "wayland_frontend"] +default = ["backend_winit", "backend_drm_legacy", "backend_drm_gbm", "backend_drm_egl", "backend_libinput", "backend_udev", "backend_session_logind", "renderer_glium", "xwayland", "wayland_frontend"] backend_winit = ["winit", "wayland-server/dlopen", "wayland-client/dlopen", "backend_egl", "renderer_gl", "use_system_lib"] backend_drm = ["drm"] backend_drm_legacy = ["backend_drm"] diff --git a/anvil/Cargo.toml b/anvil/Cargo.toml index 84864fa..a90fed6 100644 --- a/anvil/Cargo.toml +++ b/anvil/Cargo.toml @@ -25,7 +25,7 @@ features = [ "renderer_glium", "backend_egl", "wayland_frontend" ] gl_generator = "0.10" [features] -default = [ "winit", "egl", "udev" ] +default = [ "winit", "egl", "udev", "logind" ] egl = [ "smithay/use_system_lib" ] winit = [ "smithay/backend_winit" ] udev = [ "smithay/backend_libinput", "smithay/backend_drm_legacy", "smithay/backend_drm_gbm", "smithay/backend_drm_egl", "smithay/backend_udev", "smithay/backend_session" ] diff --git a/src/utils/signaling.rs b/src/utils/signaling.rs new file mode 100644 index 0000000..c88d921 --- /dev/null +++ b/src/utils/signaling.rs @@ -0,0 +1,39 @@ +use std::{rc::Rc, cell::RefCell}; + +struct SignalerInner { + closures: RefCell>> +} + +impl SignalerInner { + fn new() -> SignalerInner { + SignalerInner { + closures: RefCell::new(Vec::new()) + } + } +} + +pub struct Signaler { + inner: Rc> +} + +impl Clone for Signaler { + fn clone(&self) -> Signaler { + Signaler { + inner: self.inner.clone() + } + } +} + +impl Signaler { + pub fn new() -> Signaler { + Signaler { + inner: Rc::new(SignalerInner::new()) + } + } + + fn register_closure(&self, f: F) { + } + + fn send_event(&self, event: &mut E) { + } +}