From a89b66a2e1acfbcda8cf4519bc868c1c4046264f Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Thu, 29 Oct 2020 22:28:06 +0100 Subject: [PATCH] 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). --- dbusinterface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dbusinterface.cpp b/dbusinterface.cpp index df681d75a6..fcd9502068 100644 --- a/dbusinterface.cpp +++ b/dbusinterface.cpp @@ -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(t)) { QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createReply(clientToVariantMap(c))); - } else { + } else if (qobject_cast(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"))); } } );