Commit c963fe87 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

krunner: polish placement

Summary:
Tell the parent Dialog class what the location is so it can configure
the dialog accordingly.

Install the desktop file where it can be found by kwin to know about
X-KDE-Wayland-Interfaces=org_kde_plasma_window_management.

While at it, make sure we don't leak if we return early.

Test Plan: Now I get the right animation

Reviewers: #plasma, cblack, davidedmundson

Reviewed By: #plasma, cblack, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28783
parent 07dc5c49
......@@ -32,6 +32,7 @@ install(FILES ${krunner_dbusAppXML} DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
configure_file(krunner.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/krunner.desktop @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/krunner.desktop DESTINATION ${DATA_INSTALL_DIR}/kglobalaccel)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/krunner.desktop DESTINATION ${KDE_INSTALL_APPDIR})
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KRunnerAppDBusInterface")
configure_package_config_file(KRunnerAppDBusInterfaceConfig.cmake.in
......
......@@ -54,6 +54,7 @@ X-KDE-StartupNotify=false
X-KDE-Shortcuts=Alt+Space,Alt+F2,Search
Actions=RunClipboard
X-KDE-Wayland-Interfaces=org_kde_plasma_window_management
NoDisplay=true
[Desktop Action RunClipboard]
Exec=krunner -c
......
......@@ -236,10 +236,10 @@ void View::positionOnScreen()
QDBusPendingCall async = strutManager.asyncCall("availableScreenRect", shownOnScreen->name());
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [=]() {
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher, shownOnScreen]() {
watcher->deleteLater();
QDBusPendingReply<QRect> reply = *watcher;
setScreen(shownOnScreen);
const QRect r = reply.isValid() ? reply.value() : shownOnScreen->availableGeometry();
if (m_floating && !m_customPos.isNull()) {
......@@ -268,14 +268,13 @@ void View::positionOnScreen()
KWindowSystem::setOnDesktop(winId(), KWindowSystem::currentDesktop());
KWindowSystem::setType(winId(), NET::Normal);
//Turn the sliding effect off
KWindowEffects::slideWindow(winId(), KWindowEffects::NoEdge, 0);
setLocation(Plasma::Types::Floating);
} else {
KWindowSystem::setOnAllDesktops(winId(), true);
KWindowEffects::slideWindow(winId(), KWindowEffects::TopEdge, 0);
setLocation(Plasma::Types::TopEdge);
}
KWindowSystem::forceActiveWindow(winId());
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