backends/drm: fix udev event KWIN_DRM_DEVICES check
The existing check incorrectly compares the directory path only. This allows unintended GPUs to be added when events occur for them, such as with "udevadm trigger". Update the check to use the full path.
This commit is contained in:
parent
eb331a5df4
commit
75ab5b8353
1 changed files with 2 additions and 2 deletions
|
@ -136,9 +136,9 @@ void DrmBackend::handleUdevEvent()
|
|||
while (auto device = m_udevMonitor->getDevice()) {
|
||||
// Ignore the device seat if the KWIN_DRM_DEVICES envvar is set.
|
||||
if (!m_explicitGpus.isEmpty()) {
|
||||
const auto canonicalPath = QFileInfo(device->devNode()).canonicalPath();
|
||||
const auto canonicalPath = QFileInfo(device->devNode()).canonicalFilePath();
|
||||
const bool foundMatch = std::ranges::any_of(m_explicitGpus, [&canonicalPath](const QString &explicitPath) {
|
||||
return QFileInfo(explicitPath).canonicalPath() == canonicalPath;
|
||||
return QFileInfo(explicitPath).canonicalFilePath() == canonicalPath;
|
||||
});
|
||||
if (!foundMatch) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue