diff --git a/input/input-relay.py b/input/input-relay.py index 2c36788..8f6c861 100755 --- a/input/input-relay.py +++ b/input/input-relay.py @@ -1139,6 +1139,11 @@ def main(): # New here: a new device, or one that came back in the same place. for old in [n for n in nodes.values() if n.path == path]: drop(old, "replaced by a new device node") + # A new node is root's alone until udev gives it to the input group, a moment + # after it appears. Opened in that gap, it would fail and never be tried + # again: leave it for the next scan instead. + if not os.access(path, os.R_OK): + continue seen[path] = ino node = probe(path) if node and node.volume_keys and not take_volume(node): diff --git a/screens/vr.cpp b/screens/vr.cpp index 90624fa..065a869 100644 --- a/screens/vr.cpp +++ b/screens/vr.cpp @@ -1330,7 +1330,8 @@ void UpdateCatcher() { for (int k = 0; k < 3; ++k) params.vSource.v[k] = l.m[k][3], params.vDirection.v[k] = -l.m[k][2]; for (auto &[i, s] : g_screens) { if (!s.visible) continue; - std::vector parts(s.All().begin(), s.All().end()); + const auto all = s.All(); // one copy: two calls give two temporaries, not one range + std::vector parts(all.begin(), all.end()); for (const auto &[k, sub] : s.subs) parts.push_back(sub.overlay); for (auto o : parts) { vr::VROverlayIntersectionResults_t hit;