From 51803bb82298196ccee7285911bc9e3b71b6f920 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 23 Feb 2022 18:51:37 +0100 Subject: RemoteAccess/RPC: Assume DVI-I-1-1 is evdi output --- src/loginrpc.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-55-g7522