1
0
Fork 0
forked from wry/wry

backend: remove Copy from BackendConnectorState

This commit is contained in:
khyperia 2026-01-21 11:52:02 +01:00 committed by Julian Orth
parent 6db1f84cb2
commit 11b3f08514
14 changed files with 45 additions and 32 deletions

View file

@ -19,7 +19,12 @@ use {
},
},
jay_config::video::Transform,
std::{cell::Cell, collections::VecDeque, fmt, rc::Rc},
std::{
cell::{Cell, RefCell},
collections::VecDeque,
fmt,
rc::Rc,
},
};
pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
@ -83,7 +88,7 @@ pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
damage: Default::default(),
needs_vblank_emulation: Cell::new(false),
damage_intersect: Default::default(),
state: Cell::new(backend_state),
state: RefCell::new(backend_state),
head_managers: HeadManagers::new(state.head_names.next(), head_state),
wlr_output_heads: Default::default(),
});
@ -144,7 +149,7 @@ impl ConnectorHandler {
async fn handle_connected(&self, info: MonitorInfo) {
log::info!("Connector {} connected", self.data.connector.kernel_id());
self.data.connected.set(true);
self.data.set_state(&self.state, info.state);
self.data.set_state(&self.state, info.state.clone());
*self.data.description.borrow_mut() = create_description(&info);
let name = self.state.globals.name();
if info.non_desktop_effective {

View file

@ -138,7 +138,7 @@ impl Idle {
fn try_set_idle(&self, idle: bool) -> Result<(), BackendConnectorTransactionError> {
let mut tran = ConnectorTransaction::new(&self.state);
for connector in self.state.connectors.lock().values() {
let mut state = connector.state.get();
let mut state = connector.state.borrow().clone();
state.active = !idle;
tran.add(&connector.connector, state)?;
}