forge
Explore
Log in

Don't you dare go Hollow

tty: Remove connector arg from connector_disconnected()

Browse files at this commit

6644cc16fffb26893c3bf33ab26b2aa625bf75dcIvan MolodetskikhParent: 9e667ef
src/backend/tty.rsmodified+13 -18
@@ -325,10 +325,10 @@ impl Tty {
325 let crtcs: Vec<_> = device325 let crtcs: Vec<_> = device
326 .drm_scanner326 .drm_scanner
327 .crtcs()327 .crtcs()
328- .map(|(conn, crtc)| (conn.clone(), crtc))328+ .map(|(_conn, crtc)| crtc)
329 .collect();329 .collect();
330- for (conn, crtc) in crtcs {330+ for crtc in crtcs {
331- self.connector_disconnected(niri, node, conn, crtc);331+ self.connector_disconnected(niri, node, crtc);
332 }332 }
333 333
334 let device = self.devices.get_mut(&node).unwrap();334 let device = self.devices.get_mut(&node).unwrap();
@@ -506,9 +506,8 @@ impl Tty {
506 }506 }
507 }507 }
508 DrmScanEvent::Disconnected {508 DrmScanEvent::Disconnected {
509- connector,509+ crtc: Some(crtc), ..
510- crtc: Some(crtc),510+ } => self.connector_disconnected(niri, node, crtc),
511- } => self.connector_disconnected(niri, node, connector, crtc),
512 _ => (),511 _ => (),
513 }512 }
514 }513 }
@@ -530,11 +529,11 @@ impl Tty {
530 let crtcs: Vec<_> = device529 let crtcs: Vec<_> = device
531 .drm_scanner530 .drm_scanner
532 .crtcs()531 .crtcs()
533- .map(|(info, crtc)| (info.clone(), crtc))532+ .map(|(_info, crtc)| crtc)
534 .collect();533 .collect();
535 534
536- for (connector, crtc) in crtcs {535+ for crtc in crtcs {
537- self.connector_disconnected(niri, node, connector, crtc);536+ self.connector_disconnected(niri, node, crtc);
538 }537 }
539 538
540 let device = self.devices.remove(&node).unwrap();539 let device = self.devices.remove(&node).unwrap();
@@ -813,25 +812,21 @@ impl Tty {
813 Ok(())812 Ok(())
814 }813 }
815 814
816- fn connector_disconnected(815+ fn connector_disconnected(&mut self, niri: &mut Niri, node: DrmNode, crtc: crtc::Handle) {
817- &mut self,
818- niri: &mut Niri,
819- node: DrmNode,
820- connector: connector::Info,
821- crtc: crtc::Handle,
822- ) {
823- debug!("disconnecting connector: {connector:?}");
824-
825 let Some(device) = self.devices.get_mut(&node) else {816 let Some(device) = self.devices.get_mut(&node) else {
817+ debug!("disconnecting connector for crtc: {crtc:?}");
826 error!("missing device");818 error!("missing device");
827 return;819 return;
828 };820 };
829 821
830 let Some(surface) = device.surfaces.remove(&crtc) else {822 let Some(surface) = device.surfaces.remove(&crtc) else {
823+ debug!("disconnecting connector for crtc: {crtc:?}");
831 debug!("crtc wasn't enabled");824 debug!("crtc wasn't enabled");
832 return;825 return;
833 };826 };
834 827
828+ debug!("disconnecting connector: {:?}", surface.name);
829+
835 let output = niri830 let output = niri
836 .global_space831 .global_space
837 .outputs()832 .outputs()