From 75c84796f6baddc7caa655b3ae10d6b4411e538f Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld <4404502+Drakulix@users.noreply.github.com> Date: Thu, 6 Jan 2022 00:26:14 +0100 Subject: [PATCH] space: documentation fixes Co-authored-by: Victor Berger --- src/desktop/layer.rs | 2 +- src/desktop/mod.rs | 8 ++++---- src/desktop/popup.rs | 4 +--- src/desktop/space/mod.rs | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/desktop/layer.rs b/src/desktop/layer.rs index 17d05f7..bd9f4d2 100644 --- a/src/desktop/layer.rs +++ b/src/desktop/layer.rs @@ -307,7 +307,7 @@ impl Hash for LayerSurface { } #[derive(Debug)] -pub struct LayerSurfaceInner { +pub(crate) struct LayerSurfaceInner { pub(crate) id: usize, surface: WlrLayerSurface, namespace: String, diff --git a/src/desktop/mod.rs b/src/desktop/mod.rs index 8e2346d..354674d 100644 --- a/src/desktop/mod.rs +++ b/src/desktop/mod.rs @@ -2,7 +2,7 @@ //! //! This module contains helpers to organize and interact with desktop-style shells. //! -//! It is therefor a lot more opinionate then for example the [xdg-shell handler](crate::wayland::shell::xdg::xdg_shell_init) +//! It is therefore a lot more opinionated than for example the [xdg-shell handler](crate::wayland::shell::xdg::xdg_shell_init) //! and tightly integrates with some protocols (e.g. xdg-shell). //! //! The usage of this module is therefor entirely optional and depending on your use-case you might also only want @@ -12,7 +12,7 @@ //! //! ### [`Window`] //! -//! A window represents what is by the user typically understood as a single application window. +//! A window represents what is typically understood by the end-user as a single application window. //! //! Currently it abstracts over xdg-shell toplevels and Xwayland surfaces (TODO). //! It provides a bunch of methods to calculate and retrieve its size, manage itself, attach additional user_data @@ -45,9 +45,9 @@ //! //! ## Remarks //! -//! Note that the desktop abstractions are concerned with easing rendering different clients and therefor need to be able +//! Note that the desktop abstractions are concerned with easing rendering different clients and therefore need to be able //! to manage client buffers to do so. If you plan to use the provided drawing functions, you need to use -//! [`crate::backend::renderer::utils::on_commit_buffer_handler`]. +//! [`on_commit_buffer_handler`](crate::backend::renderer::utils::on_commit_buffer_handler). pub(crate) mod layer; mod popup; diff --git a/src/desktop/popup.rs b/src/desktop/popup.rs index d99f0eb..2dd69c5 100644 --- a/src/desktop/popup.rs +++ b/src/desktop/popup.rs @@ -43,9 +43,7 @@ impl PopupManager { if let Some(i) = self .unmapped_popups .iter() - .enumerate() - .find(|(_, p)| p.get_surface() == Some(surface)) - .map(|(i, _)| i) + .position(|p| p.get_surface() == Some(surface)) { slog::trace!(self.logger, "Popup got mapped"); let popup = self.unmapped_popups.swap_remove(i); diff --git a/src/desktop/space/mod.rs b/src/desktop/space/mod.rs index 7153d9d..3889824 100644 --- a/src/desktop/space/mod.rs +++ b/src/desktop/space/mod.rs @@ -112,7 +112,7 @@ impl Space { } } - /// Unmap a [`Window`] from this space by. + /// Unmap a [`Window`] from this space. /// /// This function does nothing for already unmapped windows pub fn unmap_window(&mut self, window: &Window) {