Reply a meaningful dBus error when detecting unmanaged windows
Currently, the method `createErrorReply()` with empty strings errors out and the client gets no answer: ``` QDBusConnection: error: could not send error message to service "": Error name cannot be empty ``` Simple test: qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole qdbus org.kde.KWin /KWin org.kde.KWin.queryWindowInfo Error name uses D-Bus Interface-like notation as suggested in https://doc.qt.io/qt-5/qdbuserror.html#name CCBUG: 340477
This commit is contained in:
parent
e5b2fca409
commit
f397f072df
1 changed files with 3 additions and 1 deletions
|
@ -219,7 +219,9 @@ QVariantMap DBusInterface::queryWindowInfo()
|
|||
if (auto c = qobject_cast<AbstractClient*>(t)) {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createReply(clientToVariantMap(c)));
|
||||
} else {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(QString(), QString()));
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(
|
||||
QStringLiteral("org.kde.KWin.Error.InvalidWindow"),
|
||||
QStringLiteral("Tried to query information about an unmanaged window")));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue