backend: remove Copy from BackendConnectorState
This commit is contained in:
parent
6db1f84cb2
commit
11b3f08514
14 changed files with 45 additions and 32 deletions
|
|
@ -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(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue