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 {
512512
513513 let node = DrmNode::from_dev_id(device_id)?;
514514
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+
515522 if self.ignored_nodes.contains(&node) {
516523 debug!("node is ignored, skipping");
517524 return Ok(());
@@ -649,6 +656,11 @@ impl Tty {
649656 return;
650657 };
651658
659+ if node.ty() != NodeType::Primary {
660+ debug!("not a primary node, skipping");
661+ return;
662+ }
663+
652664 if self.ignored_nodes.contains(&node) {
653665 debug!("node is ignored, skipping");
654666 return;
@@ -767,6 +779,11 @@ impl Tty {
767779 return;
768780 };
769781
782+ if node.ty() != NodeType::Primary {
783+ debug!("not a primary node, skipping");
784+ return;
785+ }
786+
770787 let Some(device) = self.devices.get_mut(&node) else {
771788 warn!("unknown device");
772789 return;