Commit a89b66a2 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

queryWindowInfo: Differenciate between unmannaged and user cancel

Previous fix here didn't take into account the case where use can
cancel the query (by pressing Esc).
parent 0faf2826
......@@ -22,6 +22,7 @@
#include "platform.h"
#include "kwinadaptor.h"
#include "scene.h"
#include "unmanaged.h"
#include "workspace.h"
#include "virtualdesktops.h"
#ifdef KWIN_BUILD_ACTIVITIES
......@@ -218,10 +219,14 @@ QVariantMap DBusInterface::queryWindowInfo()
[this] (Toplevel *t) {
if (auto c = qobject_cast<AbstractClient*>(t)) {
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createReply(clientToVariantMap(c)));
} else {
} else if (qobject_cast<Unmanaged*>(t)) {
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(
QStringLiteral("org.kde.KWin.Error.InvalidWindow"),
QStringLiteral("Tried to query information about an unmanaged window")));
} else {
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(
QStringLiteral("org.kde.KWin.Error.UserCancel"),
QStringLiteral("User cancelled the query")));
}
}
);
......
Markdown is supported
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