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> {
|
||||
None
|
||||
}
|
||||
fn name(&self) -> String {
|
||||
self.kernel_id().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -134,11 +134,11 @@ impl GpusPane {
|
|||
.connectors
|
||||
.lock()
|
||||
.values()
|
||||
.map(|v| v.connector.kernel_id().to_string())
|
||||
.map(|v| v.name.clone())
|
||||
.collect::<Vec<_>>();
|
||||
cs.sort();
|
||||
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 id = connector.id();
|
||||
let name = Rc::new(connector.kernel_id().to_string());
|
||||
let name = Rc::new(connector.name());
|
||||
let head_state = HeadState {
|
||||
name: RcEq(name.clone()),
|
||||
position: (0, 0),
|
||||
|
|
@ -137,7 +137,11 @@ impl ConnectorHandler {
|
|||
}
|
||||
|
||||
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.set_state(&self.state, info.state.clone());
|
||||
*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() {
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue