From 261121547d8914a4fd9b95733fedb155590583ff Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 17 Aug 2023 15:37:37 +0200 Subject: [PATCH] backends/drm: check explicit gpu paths for symlinks Otherwise we don't process hotplugs when we should --- src/backends/drm/drm_backend.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index 87db1a55bc..476d10b91f 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -29,6 +29,7 @@ #include // Qt #include +#include #include #include // system @@ -174,7 +175,10 @@ 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()) { - if (!m_explicitGpus.contains(device->devNode())) { + const bool foundMatch = std::any_of(m_explicitGpus.begin(), m_explicitGpus.end(), [&device](const QString &explicitPath) { + return QFileInfo(explicitPath).canonicalPath() == QFileInfo(device->devNode()).canonicalPath(); + }); + if (!foundMatch) { continue; } } else {