Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T04:00:49.620Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

display.rs

43 lines · 943 B · rust
1use std::{
2    fmt::Debug,
3    hash::{Hash, Hasher},
4};
5
6use anyhow::Context as _;
7use uuid::Uuid;
8use wayland_backend::client::ObjectId;
9
10use gpui::{Bounds, DisplayId, Pixels, PlatformDisplay};
11
12#[derive(Debug, Clone)]
13pub(crate) struct WaylandDisplay {
14    /// The ID of the wl_output object
15    pub id: ObjectId,
16    pub name: Option<String>,
17    pub bounds: Bounds<Pixels>,
18}
19
20impl Hash for WaylandDisplay {
21    fn hash<H: Hasher>(&self, state: &mut H) {
22        self.id.hash(state);
23    }
24}
25
26impl PlatformDisplay for WaylandDisplay {
27    fn id(&self) -> DisplayId {
28        DisplayId::new(self.id.protocol_id() as u64)
29    }
30
31    fn uuid(&self) -> anyhow::Result<Uuid> {
32        let name = self
33            .name
34            .as_ref()
35            .context("Wayland display does not have a name")?;
36        Ok(Uuid::new_v5(&Uuid::NAMESPACE_DNS, name.as_bytes()))
37    }
38
39    fn bounds(&self) -> Bounds<Pixels> {
40        self.bounds
41    }
42}
43
Served at tenant.openagents/omega Member data and write actions are omitted.