diff options
| author | srdusr <[email protected]> | 2024-12-05 01:28:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2024-12-05 01:28:00 +0200 |
| commit | 331a1a1d3a0d8dfd4c285b755c2e13785c95ee2a (patch) | |
| tree | f4fd9d058414cbed8056438aedc4941acecb2745 /crates/platform/src/lib.rs | |
| parent | 583063c3094ca0cf9f6cceba92d710b238547f6b (diff) | |
| download | srdwm-331a1a1d3a0d8dfd4c285b755c2e13785c95ee2a.tar.gz srdwm-331a1a1d3a0d8dfd4c285b755c2e13785c95ee2a.zip | |
Accumulate platform/ctl-crate additions: capture workspace, IPC responses, CLI verbs
Bundles related IPC-surface and CLI additions built up over this
session:
- capture_workspace IPC command + srd capture workspace CLI verb (see
the wayland-crate commit for the off-screen render this drives).
- Expanded IPC response payloads (monitors, client events, global menu
info) and their matching CLI plumbing.
Same reasoning as the core-crate sweep commit for why this is coarser
than the repo's usual convention: too entangled to split safely without
a dedicated review pass.
Diffstat (limited to 'crates/platform/src/lib.rs')
| -rw-r--r-- | crates/platform/src/lib.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/platform/src/lib.rs b/crates/platform/src/lib.rs index 4be9cc4..5de701f 100644 --- a/crates/platform/src/lib.rs +++ b/crates/platform/src/lib.rs @@ -8,9 +8,17 @@ //! pump, macOS's event taps) into the common [`srdwm_core::Event`] queue - //! everything downstream of that is platform-independent. +mod appmenu_registrar; +pub use appmenu_registrar::{AppmenuRegistrarState, RegistrarEvent}; + mod ipc; pub use ipc::IpcServer; +#[cfg(unix)] +mod pam_auth; +#[cfg(unix)] +pub use pam_auth::authenticate; + use srdwm_core::{Monitor, Rect, Window, WindowId}; #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -146,4 +154,22 @@ pub trait Platform { fn grab_keyboard(&mut self) -> Result<()>; fn ungrab_keyboard(&mut self) -> Result<()>; + + /// The active XKB layout's own human-readable name (e.g. `"English + /// (US)"`) - read once at startup so `WindowManager::keyboard_layout` + /// (surfaced over `srd`, for an AGS peer session's keyboard-layout + /// badge) has a real value before the first cycle, not an empty string + /// until the user cycles once. `Err(Unsupported)` on a backend with no + /// real XKB-backed seat to ask (X11, and the honest-stub Windows/macOS + /// backends) - same convention `grab_keyboard` already uses for "this + /// capability genuinely doesn't exist here" rather than inventing a + /// second one. + fn keyboard_layout(&mut self) -> Result<String>; + + /// Cycles to the next configured XKB layout (wrapping past the last + /// one back to the first) and returns its name. A no-op that returns + /// the same name back is correct, not a bug, when only one layout is + /// configured - there's nothing to cycle *to*, same as every other + /// desktop's layout switcher under the same condition. + fn cycle_keyboard_layout(&mut self) -> Result<String>; } |