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

@ -189,7 +189,7 @@ impl MetalDrmDeviceData {
ConnectorConfig {
obj: connector.clone(),
new: dd.drm_state.clone(),
state: *dd.persistent.state.borrow(),
state: dd.persistent.state.borrow().clone(),
requested: false,
changed: Default::default(),
},

View file

@ -637,7 +637,7 @@ impl MetalConnector {
| FrontState::Connected { non_desktop: true } => return,
FrontState::Connected { non_desktop: false } => {}
}
let mut state = *self.display.borrow().persistent.state.borrow();
let mut state = self.display.borrow().persistent.state.borrow().clone();
state.serial = self.state.backend_connector_state_serials.next();
self.send_event(ConnectorEvent::State(state));
}
@ -1928,7 +1928,7 @@ impl MetalBackend {
if dd.supports_bt2020 {
color_spaces.push(BackendColorSpace::Bt2020);
}
let mut state = *dd.persistent.state.borrow();
let mut state = dd.persistent.state.borrow().clone();
state.serial = self.state.backend_connector_state_serials.next();
connector.send_event(ConnectorEvent::Connected(MonitorInfo {
modes,
@ -2573,7 +2573,7 @@ impl MetalBackend {
let mut tran = dev.create_transaction();
for c in dev.connectors.lock().values() {
let dd = &*c.display.borrow();
let mut state = *dd.persistent.state.borrow();
let mut state = dd.persistent.state.borrow().clone();
let mut changed_any = false;
if disable_non_default_format && state.format != XRGB8888 {
state.format = XRGB8888;

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));
}