Commit 3b58fe4b authored by Xaver Hugl's avatar Xaver Hugl Committed by Vlad Zahorodnii
Browse files

backends/drm: consider escaped separators KWIN_DRM_DEVICES

':' conflicts with the file names in /dev/dri/by-path, so allow it to be
escaped with '\'

CCBUG: 453386


(cherry picked from commit a110aabb)
parent 6ae07b44
Pipeline #173838 passed with stage
in 13 minutes and 10 seconds
......@@ -57,12 +57,34 @@
namespace KWin
{
static QStringList splitPathList(const QString &input, const QChar delimiter)
{
QStringList ret;
QString tmp;
for (int i = 0; i < input.size(); i++) {
if (input[i] == delimiter) {
if (i > 0 && input[i - 1] == '\\') {
tmp[tmp.size() - 1] = delimiter;
} else if (!tmp.isEmpty()) {
ret.append(tmp);
tmp = QString();
}
} else {
tmp.append(input[i]);
}
}
if (!tmp.isEmpty()) {
ret.append(tmp);
}
return ret;
}
DrmBackend::DrmBackend(QObject *parent)
: Platform(parent)
, m_udev(new Udev)
, m_udevMonitor(m_udev->monitor())
, m_session(Session::create(this))
, m_explicitGpus(qEnvironmentVariable("KWIN_DRM_DEVICES").split(':', Qt::SkipEmptyParts))
, m_explicitGpus(splitPathList(qEnvironmentVariable("KWIN_DRM_DEVICES"), ':'))
, m_dpmsFilter()
{
setSupportsPointerWarping(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment