Restore logind as a default feature

This commit is contained in:
Victor Berger 2020-04-05 20:03:09 +02:00
parent b8c20ebf30
commit 1b5537d537
3 changed files with 41 additions and 2 deletions

View File

@ -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"]

View File

@ -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" ]

39
src/utils/signaling.rs Normal file
View File

@ -0,0 +1,39 @@
use std::{rc::Rc, cell::RefCell};
struct SignalerInner<E> {
closures: RefCell<Vec<Box<dyn FnMut(&mut E)>>>
}
impl<E> SignalerInner<E> {
fn new() -> SignalerInner<E> {
SignalerInner {
closures: RefCell::new(Vec::new())
}
}
}
pub struct Signaler<E> {
inner: Rc<SignalerInner<E>>
}
impl<E> Clone for Signaler<E> {
fn clone(&self) -> Signaler<E> {
Signaler {
inner: self.inner.clone()
}
}
}
impl<E> Signaler<E> {
pub fn new() -> Signaler<E> {
Signaler {
inner: Rc::new(SignalerInner::new())
}
}
fn register_closure<F: FnMut(&mut E) + 'static>(&self, f: F) {
}
fn send_event(&self, event: &mut E) {
}
}