diff --git a/udev.cpp b/udev.cpp --- a/udev.cpp +++ b/udev.cpp @@ -18,6 +18,7 @@ along with this program. If not, see . *********************************************************************/ #include "udev.h" +#include "logind.h" // Qt #include #include @@ -106,6 +107,7 @@ if (m_enumerate.isNull()) { return UdevDevice::Ptr(); } + QString defaultSeat = QStringLiteral("seat0"); udev_list_entry *it = udev_enumerate_get_list_entry(m_enumerate.data()); UdevDevice::Ptr firstFound; while (it) { @@ -115,6 +117,13 @@ if (!device) { continue; } + QString deviceSeat = device->property("ID_SEAT"); + if (deviceSeat.isEmpty()) { + deviceSeat = defaultSeat; + } + if (deviceSeat != LogindIntegration::self()->seat()) { + continue; + } if (test(device)) { return device; } @@ -135,7 +144,6 @@ enumerate.addMatch(UdevEnumerate::Match::SysName, "card[0-9]*"); enumerate.scan(); return enumerate.find([](const UdevDevice::Ptr &device) { - // TODO: check seat auto pci = device->getParentWithSubsystemDevType("pci"); if (!pci) { return false;