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"))); } } );