xwayland: review documentation

This commit is contained in:
Victor Berger 2021-07-01 22:06:25 +02:00 committed by Victor Berger
parent 811df39214
commit 7b3585ad36
2 changed files with 11 additions and 3 deletions

View File

@ -3,8 +3,8 @@
//! This module contains helpers to manage XWayland from your compositor, in order //! This module contains helpers to manage XWayland from your compositor, in order
//! to support running X11 apps. //! to support running X11 apps.
//! //!
//! The starting point is the [`XWayland`](struct.XWayland.html) struct, which represents the //! The starting point is the [`XWayland`] struct, which represents the
//! running `XWayland` instance. Dropping it will shutdown XWayland. //! running XWayland instance. Dropping it will shutdown XWayland.
//! //!
//! You need to provide an implementation of a X11 Window Manager for XWayland to //! 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 //! function properly. You'll need to treat XWayland (and all its X11 apps) as one
@ -15,4 +15,4 @@
mod x11_sockets; mod x11_sockets;
mod xserver; mod xserver;
pub use self::xserver::{XWayland, XWaylandEvent}; pub use self::xserver::{XWayland, XWaylandEvent, XWaylandSource};

View File

@ -96,6 +96,9 @@ pub enum XWaylandEvent {
impl<Data: Any + 'static> XWayland<Data> { impl<Data: Any + 'static> XWayland<Data> {
/// Create a new XWayland manager /// 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<L>( pub fn new<L>(
handle: LoopHandle<'static, Data>, handle: LoopHandle<'static, Data>,
display: Rc<RefCell<Display>>, display: Rc<RefCell<Display>>,
@ -230,6 +233,11 @@ fn launch<Data: Any>(inner: &Rc<RefCell<Inner<Data>>>) -> std::io::Result<()> {
Ok(()) 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)] #[derive(Debug)]
pub struct XWaylandSource { pub struct XWaylandSource {
channel: Channel<XWaylandEvent>, channel: Channel<XWaylandEvent>,