Commit eca6e90b authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Fix single instance window activation on Wayland

parent 76c9e11a
Pipeline #180174 passed with stage
in 1 minute and 48 seconds
......@@ -32,6 +32,7 @@ target_link_libraries(bluedevil-sendfile
KF5::WidgetsAddons
KF5::KIOFileWidgets
KF5::BluezQt
KF5::WindowSystem
)
install(TARGETS bluedevil-sendfile DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -15,6 +15,7 @@
#include <KAboutData>
#include <KDBusService>
#include <KLocalizedString>
#include <KWindowSystem>
int main(int argc, char *argv[])
{
......@@ -74,7 +75,8 @@ int main(int argc, char *argv[])
SendFileWizard *wizard = new SendFileWizard(deviceInfo, parser.values(filesOption));
QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() {
wizard->setWindowState((wizard->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
KWindowSystem::updateStartupId(wizard->windowHandle());
KWindowSystem::activateWindow(wizard->windowHandle());
});
return app.exec();
......
......@@ -30,6 +30,7 @@ target_link_libraries(bluedevil-wizard
KF5::DBusAddons
KF5::Notifications
KF5::WidgetsAddons
KF5::WindowSystem
KF5::BluezQt)
install(TARGETS bluedevil-wizard ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -16,6 +16,7 @@
#include <KAboutData>
#include <KDBusService>
#include <KLocalizedString>
#include <KWindowSystem>
int main(int argc, char *argv[])
{
......@@ -56,7 +57,8 @@ int main(int argc, char *argv[])
BlueWizard *wizard = new BlueWizard;
QObject::connect(&service, &KDBusService::activateRequested, wizard, [wizard]() {
wizard->setWindowState((wizard->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
KWindowSystem::updateStartupId(wizard->windowHandle());
KWindowSystem::activateWindow(wizard->windowHandle());
});
return app.exec();
......
Supports Markdown
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