Skip to content

Commit 8ee08ef

Browse files
elinorbgrvberger
authored andcommitted
wayland: document general behaviour of the client handlers
1 parent 8934bf1 commit 8ee08ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/wayland/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
//!
33
//! This module contains several handlers to manage the wayland protocol
44
//! and the clients.
5+
//!
6+
//! Most utilities provided in this module work in the wame way:
7+
//!
8+
//! - An init function or method will take the event loop as argument and
9+
//! insert one or more globals into it.
10+
//! - These functions will return the `Global` handles and, if applicable,
11+
//! a `StateToken` allowing you to access the associated state value in
12+
//! this event loop.
13+
//! - If you want to remove a previously inserted global, just call the
14+
//! `destroy()` method on the associated `Global`. If you don't plan to
15+
//! destroy the global at all, you don't need to bother keeping the
16+
//! `Global` around.
17+
//! - You should not remove a state value from the event loop if you have
18+
//! not previously destroyed all the globals using it, otherwise you'll
19+
//! quickly encounter a panic.
520
621
pub mod compositor;
722
pub mod output;

0 commit comments

Comments
 (0)