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

@ -506,7 +506,7 @@ impl XBackend {
next_image: Default::default(),
cb: CloneCell::new(None),
images,
state: Cell::new(state),
state: RefCell::new(state),
});
{
let class = "jay\0jay\0";
@ -604,7 +604,7 @@ impl XBackend {
color_spaces: vec![],
primaries: Primaries::SRGB,
luminance: None,
state: output.state.get(),
state: output.state.borrow().clone(),
}));
output.changed();
self.present(output).await;
@ -983,11 +983,11 @@ impl XBackend {
old.tex.set(new.tex.get());
old.pixmap.set(new.pixmap.get());
}
let mut state = output.state.get();
let mut state = output.state.borrow().clone();
state.serial = self.state.backend_connector_state_serials.next();
state.mode.width = width;
state.mode.height = height;
output.state.set(state);
*output.state.borrow_mut() = state.clone();
output.events.push(ConnectorEvent::State(state));
output.changed();
}
@ -1057,7 +1057,7 @@ struct XOutput {
next_image: NumCell<usize>,
images: [XImage; 2],
cb: CloneCell<Option<Rc<dyn Fn()>>>,
state: Cell<BackendConnectorState>,
state: RefCell<BackendConnectorState>,
}
struct XImage {
@ -1133,7 +1133,7 @@ struct XTransaction {
impl XTransaction {
fn send_state(&self) {
for con in self.connectors.values() {
let mut state = con.state.get();
let mut state = con.state.borrow().clone();
state.serial = con.backend.state.backend_connector_state_serials.next();
con.events.push(ConnectorEvent::State(state));
}