backend: take connector name from connector
This commit is contained in:
parent
d321e888be
commit
52b91654ca
3 changed files with 12 additions and 5 deletions
|
|
@ -170,6 +170,9 @@ pub trait Connector: Any {
|
||||||
fn gamma_lut_size(&self) -> Option<u32> {
|
fn gamma_lut_size(&self) -> Option<u32> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
fn name(&self) -> String {
|
||||||
|
self.kernel_id().to_string()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
||||||
|
|
@ -134,11 +134,11 @@ impl GpusPane {
|
||||||
.connectors
|
.connectors
|
||||||
.lock()
|
.lock()
|
||||||
.values()
|
.values()
|
||||||
.map(|v| v.connector.kernel_id().to_string())
|
.map(|v| v.name.clone())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
cs.sort();
|
cs.sort();
|
||||||
for c in cs {
|
for c in cs {
|
||||||
ui.label(c);
|
ui.label(&**c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ pub fn handle(state: &Rc<State>, connector: &Rc<dyn Connector>) {
|
||||||
}
|
}
|
||||||
let backend_state = connector.state();
|
let backend_state = connector.state();
|
||||||
let id = connector.id();
|
let id = connector.id();
|
||||||
let name = Rc::new(connector.kernel_id().to_string());
|
let name = Rc::new(connector.name());
|
||||||
let head_state = HeadState {
|
let head_state = HeadState {
|
||||||
name: RcEq(name.clone()),
|
name: RcEq(name.clone()),
|
||||||
position: (0, 0),
|
position: (0, 0),
|
||||||
|
|
@ -137,7 +137,11 @@ impl ConnectorHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_connected(&self, info: MonitorInfo) {
|
async fn handle_connected(&self, info: MonitorInfo) {
|
||||||
log::info!("Connector {} connected", self.data.connector.kernel_id());
|
log::info!(
|
||||||
|
"Connector {} connected ({})",
|
||||||
|
self.data.name,
|
||||||
|
self.data.connector.kernel_id(),
|
||||||
|
);
|
||||||
self.data.connected.set(true);
|
self.data.connected.set(true);
|
||||||
self.data.set_state(&self.state, info.state.clone());
|
self.data.set_state(&self.state, info.state.clone());
|
||||||
*self.data.description.borrow_mut() = create_description(&info);
|
*self.data.description.borrow_mut() = create_description(&info);
|
||||||
|
|
@ -153,7 +157,7 @@ impl ConnectorHandler {
|
||||||
for head in self.data.wlr_output_heads.lock().drain_values() {
|
for head in self.data.wlr_output_heads.lock().drain_values() {
|
||||||
head.handle_disconnected();
|
head.handle_disconnected();
|
||||||
}
|
}
|
||||||
log::info!("Connector {} disconnected", self.data.connector.kernel_id());
|
log::info!("Connector {} disconnected", self.data.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_desktop_connected(&self, info: MonitorInfo, name: GlobalName) {
|
async fn handle_desktop_connected(&self, info: MonitorInfo, name: GlobalName) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue