forge
Explore
Log in

Don't you dare go Hollow

backend/tty: Consider only primary node in drm udev event

Browse files at this commit

c8eea8ee9ddf795da8cb356599f17e2dc7cfea20athul-krishna-krParent: 23cd5aa
src/backend/tty.rsmodified+17 -0
@@ -512,6 +512,13 @@ impl Tty {
512 512
513 let node = DrmNode::from_dev_id(device_id)?;513 let node = DrmNode::from_dev_id(device_id)?;
514 514
515+ // Only consider primary node on udev event
516+ // https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/768fbaad54027f8dd027e7e015e8eeb93cb38c52
517+ if node.ty() != NodeType::Primary {
518+ debug!("not a primary node, skipping");
519+ return Ok(());
520+ }
521+
515 if self.ignored_nodes.contains(&node) {522 if self.ignored_nodes.contains(&node) {
516 debug!("node is ignored, skipping");523 debug!("node is ignored, skipping");
517 return Ok(());524 return Ok(());
@@ -649,6 +656,11 @@ impl Tty {
649 return;656 return;
650 };657 };
651 658
659+ if node.ty() != NodeType::Primary {
660+ debug!("not a primary node, skipping");
661+ return;
662+ }
663+
652 if self.ignored_nodes.contains(&node) {664 if self.ignored_nodes.contains(&node) {
653 debug!("node is ignored, skipping");665 debug!("node is ignored, skipping");
654 return;666 return;
@@ -767,6 +779,11 @@ impl Tty {
767 return;779 return;
768 };780 };
769 781
782+ if node.ty() != NodeType::Primary {
783+ debug!("not a primary node, skipping");
784+ return;
785+ }
786+
770 let Some(device) = self.devices.get_mut(&node) else {787 let Some(device) = self.devices.get_mut(&node) else {
771 warn!("unknown device");788 warn!("unknown device");
772 return;789 return;