diff --git a/components/mobileshellstate/shelldbusclient.cpp b/components/mobileshellstate/shelldbusclient.cpp index 4df1f179..128e53be 100644 --- a/components/mobileshellstate/shelldbusclient.cpp +++ b/components/mobileshellstate/shelldbusclient.cpp @@ -113,18 +113,36 @@ void ShellDBusClient::showVolumeOSD() void ShellDBusClient::updateDoNotDisturb() { - m_doNotDisturb = m_interface->doNotDisturb(); - Q_EMIT doNotDisturbChanged(); + auto reply = m_interface->doNotDisturb(); + auto watcher = new QDBusPendingCallWatcher(reply, this); + + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](auto watcher) { + QDBusPendingReply reply = *watcher; + m_doNotDisturb = reply.argumentAt<0>(); + Q_EMIT doNotDisturbChanged(); + }); } void ShellDBusClient::updateIsActionDrawerOpen() { - m_isActionDrawerOpen = m_interface->isActionDrawerOpen(); - Q_EMIT isActionDrawerOpenChanged(); + auto reply = m_interface->isActionDrawerOpen(); + auto watcher = new QDBusPendingCallWatcher(reply, this); + + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](auto watcher) { + QDBusPendingReply reply = *watcher; + m_isActionDrawerOpen = reply.argumentAt<0>(); + Q_EMIT isActionDrawerOpenChanged(); + }); } void ShellDBusClient::updateIsTaskSwitcherVisible() { - m_isTaskSwitcherVisible = m_interface->isTaskSwitcherVisible(); - Q_EMIT isTaskSwitcherVisibleChanged(); + auto reply = m_interface->isTaskSwitcherVisible(); + auto watcher = new QDBusPendingCallWatcher(reply, this); + + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](auto watcher) { + QDBusPendingReply reply = *watcher; + m_isTaskSwitcherVisible = reply.argumentAt<0>(); + Q_EMIT isTaskSwitcherVisibleChanged(); + }); } diff --git a/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp b/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp index 3fcab38d..f0d70f67 100644 --- a/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp +++ b/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp @@ -263,6 +263,8 @@ void MobileTaskSwitcherEffect::setDBusState(bool active) QStringLiteral("org.kde.plasmashell"), QStringLiteral("setIsTaskSwitcherVisible")); request.setArguments({active}); - const QDBusReply response = QDBusConnection::sessionBus().call(request, QDBus::NoBlock); + + // this does not block, so it won't necessarily be called before the method returns + QDBusConnection::sessionBus().send(request); } }