From 7b3585ad36bb4cc99f30c7c4317d2a9e0bdeed4e Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Thu, 1 Jul 2021 22:06:25 +0200 Subject: [PATCH] xwayland: review documentation --- src/xwayland/mod.rs | 6 +++--- src/xwayland/xserver.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/xwayland/mod.rs b/src/xwayland/mod.rs index 818117e..5cb6707 100644 --- a/src/xwayland/mod.rs +++ b/src/xwayland/mod.rs @@ -3,8 +3,8 @@ //! This module contains helpers to manage XWayland from your compositor, in order //! to support running X11 apps. //! -//! The starting point is the [`XWayland`](struct.XWayland.html) struct, which represents the -//! running `XWayland` instance. Dropping it will shutdown XWayland. +//! The starting point is the [`XWayland`] struct, which represents the +//! running XWayland instance. Dropping it will shutdown XWayland. //! //! You need to provide an implementation of a X11 Window Manager for XWayland to //! function properly. You'll need to treat XWayland (and all its X11 apps) as one @@ -15,4 +15,4 @@ mod x11_sockets; mod xserver; -pub use self::xserver::{XWayland, XWaylandEvent}; +pub use self::xserver::{XWayland, XWaylandEvent, XWaylandSource}; diff --git a/src/xwayland/xserver.rs b/src/xwayland/xserver.rs index 75a14d0..e50bbca 100644 --- a/src/xwayland/xserver.rs +++ b/src/xwayland/xserver.rs @@ -96,6 +96,9 @@ pub enum XWaylandEvent { impl XWayland { /// Create a new XWayland manager + /// + /// This function returns both the [`XWayland`] handle and an [`XWaylandSource`] that needs to be inserted + /// into the [`calloop`] event loop, producing the Xwayland startup and shutdown events. pub fn new( handle: LoopHandle<'static, Data>, display: Rc>, @@ -230,6 +233,11 @@ fn launch(inner: &Rc>>) -> std::io::Result<()> { Ok(()) } +/// An event source for monitoring XWayland status +/// +/// You need to insert it in a [`calloop`] event loop to handle the events it produces, +/// of type [`XWaylandEvent`], which notify you about startup and shutdown of the Xwayland +/// instance. #[derive(Debug)] pub struct XWaylandSource { channel: Channel,