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
This commit is contained in:
parent
5ddcd0827b
commit
a110aabbcc
1 changed files with 23 additions and 1 deletions
|
@ -55,12 +55,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);
|
||||
|
|
Loading…
Reference in a new issue