Remove AbstractClient plumbing casts in DbusInterface
This commit is contained in:
parent
348e20e20f
commit
a429739f98
1 changed files with 9 additions and 7 deletions
|
@ -235,16 +235,18 @@ QVariantMap DBusInterface::queryWindowInfo()
|
|||
setDelayedReply(true);
|
||||
kwinApp()->platform()->startInteractiveWindowSelection(
|
||||
[this](AbstractClient *t) {
|
||||
if (auto c = static_cast<AbstractClient *>(t->isClient() ? t : nullptr)) {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createReply(clientToVariantMap(c)));
|
||||
} 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 {
|
||||
if (!t) {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(
|
||||
QStringLiteral("org.kde.KWin.Error.UserCancel"),
|
||||
QStringLiteral("User cancelled the query")));
|
||||
return;
|
||||
}
|
||||
if (t->isClient()) {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createReply(clientToVariantMap(t)));
|
||||
} else {
|
||||
QDBusConnection::sessionBus().send(m_replyQueryWindowInfo.createErrorReply(
|
||||
QStringLiteral("org.kde.KWin.Error.InvalidWindow"),
|
||||
QStringLiteral("Tried to query information about an unmanaged window")));
|
||||
}
|
||||
});
|
||||
return QVariantMap{};
|
||||
|
|
Loading…
Reference in a new issue