Commit 6fcc54a5 authored by David Redondo's avatar David Redondo 🏎
Browse files

[KRunner] Do not use QDBusInterface

Saves one blocking introspection call
parent 694efc31
......@@ -238,9 +238,10 @@ void View::positionOnScreen()
// in wayland, QScreen::availableGeometry() returns QScreen::geometry()
// we could get a better value from plasmashell
// BUG: 386114
QDBusInterface strutManager("org.kde.plasmashell", "/StrutManager", "org.kde.PlasmaShell.StrutManager");
QDBusPendingCall async = strutManager.asyncCall("availableScreenRect", shownOnScreen->name());
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
auto message = QDBusMessage::createMethodCall("org.kde.plasmashell", "/StrutManager", "org.kde.PlasmaShell.StrutManager", "availableScreenRect");
message.setArguments({shownOnScreen->name()});
QDBusPendingCall call = QDBusConnection::sessionBus().asyncCall(message);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, shownOnScreen]() {
watcher->deleteLater();
......
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