1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! StatusNotifierHost registration.
//!
//! Per the [SNI spec], a `StatusNotifierHost` is an object in an application
//! that does the actual graphical representation of tray items. It doesn't
//! need any particular methods or signals on the bus — just the presence of
//! the well-known name `org.freedesktop.StatusNotifierHost-{pid}` is enough
//! to signal items that a graphical shell is running.
//!
//! If no host is registered, SNI items may fall back to the X11 system tray
//! protocol (XDG shell / `_NET_SYSTEM_TRAY`).
//!
//! [SNI spec]: https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/
use DuplexConn;
use MarshalledMessage;
use standard_messages;
use VecDeque;
use crateResult;
/// Register as `org.freedesktop.StatusNotifierHost-{pid}` on the session bus.
///
/// This acquires a unique well-known name so tray items know a host is
/// present. The name is automatically released when the D-Bus connection
/// is dropped.
///
/// Unexpected D-Bus messages (e.g. `RegisterStatusNotifierItem` calls from
/// items responding to `StatusNotifierHostRegistered`) arriving during the
/// synchronous wait are buffered into `pending` for later processing.