1
0
Fork 0
forked from wry/wry

backend: take initial backend state from backend

This commit is contained in:
Julian Orth 2026-03-17 20:41:00 +01:00
parent 1a9753847a
commit d321e888be
8 changed files with 88 additions and 71 deletions

View file

@ -2,8 +2,10 @@ use {
crate::{
async_engine::SpawnedFuture,
backend::{
Backend, Connector, ConnectorEvent, ConnectorId, ConnectorKernelId, DrmDeviceId,
self, Backend, BackendConnectorState, BackendConnectorStateSerial, Connector,
ConnectorEvent, ConnectorId, ConnectorKernelId, DrmDeviceId,
},
format::XRGB8888,
video::drm::ConnectorType,
},
std::{error::Error, rc::Rc},
@ -52,4 +54,25 @@ impl Connector for DummyOutput {
fn effectively_locked(&self) -> bool {
true
}
fn state(&self) -> BackendConnectorState {
let mode = backend::Mode {
width: 0,
height: 0,
refresh_rate_millihz: 40_000,
};
BackendConnectorState {
serial: BackendConnectorStateSerial::from_raw(0),
enabled: true,
active: false,
mode,
non_desktop_override: None,
vrr: false,
tearing: false,
format: XRGB8888,
color_space: Default::default(),
eotf: Default::default(),
gamma_lut: Default::default(),
}
}
}

View file

@ -867,6 +867,10 @@ impl Connector for MetalConnector {
fb.locked
}
fn state(&self) -> BackendConnectorState {
self.display.borrow().persistent.state.borrow().clone()
}
fn caps(&self) -> ConnectorCaps {
CONCAP_CONNECTOR | CONCAP_MODE_SETTING | CONCAP_PHYSICAL_DISPLAY
}

View file

@ -1113,6 +1113,10 @@ impl Connector for XOutput {
true
}
fn state(&self) -> BackendConnectorState {
self.state.borrow().clone()
}
fn transaction_type(&self) -> Box<dyn BackendConnectorTransactionTypeDyn> {
Box::new(XTransactionType)
}