commit | 59728f9802c7869a9b47d6176296086dc0d00d45 | [log] [tgz] |
---|---|---|
author | Cameron Gutman <cameron.gutman@gmail.com> | Wed Nov 20 20:27:45 2019 -0800 |
committer | Cameron Gutman <cameron.gutman@gmail.com> | Wed Nov 20 20:27:45 2019 -0800 |
tree | 5c83b85167fffa56271d6f73ffcf93063dc1d4c5 | |
parent | 8fd426855c9927f7089d6a2b7105bf0f64b8a284 [diff] |
Use stat() to minimize input device opens when not using udev Calling open() on input devices can generate device I/O which blocks the main thread and causes dropped frames. Using stat() we can avoid opening anything unless /dev/input has changed since we last polled. We could have used something fancy like inotify, but it didn't seem worth the added complexity for this uncommon non-udev case.