From 7b1c0501f3eafc5aeaf2a2306d73c554ad67cf94 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Mon, 22 Nov 2021 13:46:34 -0600 Subject: [PATCH] clean up warnings from github --- src/backend/winit/mod.rs | 5 +++-- src/backend/x11/mod.rs | 8 ++------ src/backend/x11/window_inner.rs | 2 -- src/wayland/output/xdg.rs | 4 ++-- src/wayland/shell/wlr_layer/mod.rs | 4 ++-- src/wayland/xdg_activation/mod.rs | 4 ++-- src/wayland/xdg_foreign/mod.rs | 11 ++--------- 7 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/backend/winit/mod.rs b/src/backend/winit/mod.rs index 9a5148b..c534fed 100644 --- a/src/backend/winit/mod.rs +++ b/src/backend/winit/mod.rs @@ -85,7 +85,8 @@ impl WindowSize { #[derive(Debug)] pub struct WinitGraphicsBackend { renderer: Gles2Renderer, - display: EGLDisplay, + // The display isn't used past this point but must be kept alive. + _display: EGLDisplay, egl: Rc, window: Rc, size: Rc>, @@ -223,7 +224,7 @@ where Ok(( WinitGraphicsBackend { window: window.clone(), - display, + _display: display, egl, renderer, size: size.clone(), diff --git a/src/backend/x11/mod.rs b/src/backend/x11/mod.rs index a00b160..31dcb9a 100644 --- a/src/backend/x11/mod.rs +++ b/src/backend/x11/mod.rs @@ -83,7 +83,7 @@ use x11rb::{ protocol::{ self as x11, dri3::ConnectionExt as _, - xproto::{ColormapAlloc, ConnectionExt, Depth, PixmapWrapper, VisualClass}, + xproto::{ColormapAlloc, ConnectionExt, PixmapWrapper, VisualClass}, ErrorKind, }, rust_connection::{ReplyError, RustConnection}, @@ -124,8 +124,6 @@ pub struct X11Backend { window: Arc, resize: Sender>, key_counter: Arc, - depth: Depth, - visual_id: u32, } atom_manager! { @@ -231,7 +229,7 @@ impl X11Backend { title, format, atoms, - depth.clone(), + depth, visual_id, colormap, extensions, @@ -254,8 +252,6 @@ impl X11Backend { connection, window, key_counter: Arc::new(AtomicU32::new(0)), - depth, - visual_id, screen_number, resize: resize_send, }; diff --git a/src/backend/x11/window_inner.rs b/src/backend/x11/window_inner.rs index 4f2c838..2bb4bdc 100644 --- a/src/backend/x11/window_inner.rs +++ b/src/backend/x11/window_inner.rs @@ -57,7 +57,6 @@ pub(crate) struct WindowInner { pub connection: Weak, pub id: x11::Window, root: x11::Window, - present_event_id: u32, pub atoms: Atoms, pub cursor_state: Arc>, pub size: Mutex>, @@ -147,7 +146,6 @@ impl WindowInner { connection: weak, id: window, root: screen.root, - present_event_id, atoms, cursor_state: Arc::new(Mutex::new(CursorState::default())), size: Mutex::new(size), diff --git a/src/wayland/output/xdg.rs b/src/wayland/output/xdg.rs index 0a8e5a7..6ed1cee 100644 --- a/src/wayland/output/xdg.rs +++ b/src/wayland/output/xdg.rs @@ -29,7 +29,7 @@ struct Inner { scale: i32, instances: Vec, - log: ::slog::Logger, + _log: ::slog::Logger, } #[derive(Debug, Clone)] @@ -58,7 +58,7 @@ impl XdgOutput { scale: output.scale, instances: Vec::new(), - log, + _log: log, })), } } diff --git a/src/wayland/shell/wlr_layer/mod.rs b/src/wayland/shell/wlr_layer/mod.rs index 6ac7a30..5e57e0d 100644 --- a/src/wayland/shell/wlr_layer/mod.rs +++ b/src/wayland/shell/wlr_layer/mod.rs @@ -165,7 +165,7 @@ impl LayerShellState { #[derive(Clone)] struct ShellUserData { - log: ::slog::Logger, + _log: ::slog::Logger, user_impl: Rc)>>, shell_state: Arc>, } @@ -189,7 +189,7 @@ where })); let shell_data = ShellUserData { - log: log.new(slog::o!("smithay_module" => "layer_shell_handler")), + _log: log.new(slog::o!("smithay_module" => "layer_shell_handler")), user_impl: Rc::new(RefCell::new(implementation)), shell_state: shell_state.clone(), }; diff --git a/src/wayland/xdg_activation/mod.rs b/src/wayland/xdg_activation/mod.rs index cdeb58d..e4b421e 100644 --- a/src/wayland/xdg_activation/mod.rs +++ b/src/wayland/xdg_activation/mod.rs @@ -133,7 +133,7 @@ impl XdgActivationTokenData { /// Tracks the list of pending and current activation requests #[derive(Debug)] pub struct XdgActivationState { - log: ::slog::Logger, + _log: ::slog::Logger, user_data: UserDataMap, pending_tokens: HashMap, @@ -203,7 +203,7 @@ where let implementation = Rc::new(RefCell::new(implementation)); let activation_state = Arc::new(Mutex::new(XdgActivationState { - log: log.new(slog::o!("smithay_module" => "xdg_activation_handler")), + _log: log.new(slog::o!("smithay_module" => "xdg_activation_handler")), user_data: UserDataMap::new(), pending_tokens: HashMap::new(), activation_requests: HashMap::new(), diff --git a/src/wayland/xdg_foreign/mod.rs b/src/wayland/xdg_foreign/mod.rs index 14adfb4..0e18289 100644 --- a/src/wayland/xdg_foreign/mod.rs +++ b/src/wayland/xdg_foreign/mod.rs @@ -47,8 +47,7 @@ use wayland_server::{Display, Filter, Global, Main}; /// Manages all exported and imported surfaces. #[derive(Debug)] pub struct XdgForeignState { - log: ::slog::Logger, - shell: Arc>, + _log: ::slog::Logger, exports: Vec, } @@ -85,9 +84,8 @@ where let log = crate::slog_or_fallback(logger); let state = Arc::new(Mutex::new(XdgForeignState { - log: log.new(slog::o!("smithay_module" => "xdg_foreign_handler")), + _log: log.new(slog::o!("smithay_module" => "xdg_foreign_handler")), exports: vec![], - shell: xdg_shell_state.clone(), })); // Borrow checking does not like us cloning the state inside the filter's closure so we clone @@ -121,8 +119,6 @@ struct Export { inner: zxdg_exported_v2::ZxdgExportedV2, /// All imports made from this export. imports: Vec, - /// Whether this export was created by the compositor or a client. - compositor_created: bool, } impl Export { @@ -152,7 +148,6 @@ impl PartialEq for Export { struct Import { inner: zxdg_imported_v2::ZxdgImportedV2, surface: WlSurface, - handle: String, /// Child surfaces which have imported this surface as a parent. children: Vec, } @@ -291,7 +286,6 @@ fn exporter_implementation( handle: handle.clone(), inner: id.deref().clone(), imports: vec![], - compositor_created: false, }); handle @@ -370,7 +364,6 @@ fn importer_implementation( export.imports.push(Import { inner, surface: export.surface.clone(), - handle: export.handle.clone(), children: vec![], }); }