Expand description
Which display server this session is actually running.
On macOS and Windows the windowing system is a compile-time fact. On Linux it is not: the same binary on the same machine faces X11 or Wayland depending on which session the user logged into, and the two need different injection paths entirely.
Getting this wrong is not a crash, it is worse. Injecting through
XWayland on a Wayland session reaches X clients only, so the pointer
travels over native windows that never receive the events — a run that
clicks through some windows and not others, reporting success either
way. So the answer is decided once, here, from the environment, and a
session we cannot name is refused rather than assumed.
The environment is passed in rather than read here: this crate is platform-free, and a decision that takes its inputs as arguments is a decision that can be tested against every session shape without needing that session.
Enums§
- Server
- The display server a Linux session is running.
Functions§
- detect
- Decide from the three variables that describe a Linux session.