summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/loginrpc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/loginrpc.cpp b/src/loginrpc.cpp
index a4e61fc..24b5b11 100644
--- a/src/loginrpc.cpp
+++ b/src/loginrpc.cpp
@@ -74,7 +74,7 @@ void LoginRpc::handleCommandV1(const QString &command)
QString out = QString::fromLocal8Bit(p.readAll());
QRegularExpression re("^(\\S+)\\s.*?(\\w*connected)", QRegularExpression::MultilineOption);
QRegularExpressionMatchIterator it = re.globalMatch(out);
- QString virtOut;
+ QString virtOut, evdiOut;
QStringList allOutputs;
while (it.hasNext()) {
QRegularExpressionMatch m = it.next();
@@ -83,10 +83,17 @@ void LoginRpc::handleCommandV1(const QString &command)
|| output == QLatin1String("Virtual1") || output == QLatin1String("Virtual-1")
|| output == QLatin1String("default"))) {
virtOut = output;
+ } else if (output == QLatin1String("DVI-I-1-1")) {
+ evdiOut = output;
} else {
allOutputs << output;
}
}
+ if (virtOut.isEmpty()) {
+ virtOut = evdiOut;
+ } else if (!evdiOut.isEmpty()) {
+ allOutputs << evdiOut;
+ }
qDebug() << "Virtual output:" << virtOut << "unwanted additional outputs:" << allOutputs;
p.kill();
int ret = -1;