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

Fix activating running instance on Wayland

parent 7d88da30
Pipeline #176600 passed with stage
in 3 minutes and 10 seconds
......@@ -29,6 +29,7 @@ Dependencies:
'frameworks/kcrash': '@stable'
'frameworks/kio': '@stable'
'frameworks/kfilemetadata': '@stable'
'frameworks/kwindowsystem': '@stable'
- 'on': ['Linux']
'require':
......
......@@ -81,7 +81,7 @@ if (ANDROID)
find_package(Gradle REQUIRED)
else()
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets DBus)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DBusAddons QQC2DesktopStyle)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS DBusAddons QQC2DesktopStyle WindowSystem)
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS Solid Crash FileMetaData KIO)
endif()
if (TARGET KF5::Crash)
......
......@@ -200,6 +200,7 @@ else ()
target_link_libraries(itinerary PRIVATE Qt::Positioning Qt::DBus Qt::Widgets)
target_link_libraries(itinerary-app PRIVATE
KF5::DBusAddons
KF5::WindowSystem
Qt::Widgets
)
set_target_properties(itinerary-app PROPERTIES OUTPUT_NAME "itinerary")
......
......@@ -57,6 +57,7 @@
#ifndef Q_OS_ANDROID
#include <KDBusService>
#include <KWindowSystem>
#endif
#include <KLocalizedContext>
......@@ -375,7 +376,9 @@ int main(int argc, char **argv)
handleCommandLineArguments(&appController, parser.positionalArguments(), parser.isSet(isTemporaryOpt), parser.value(pageOpt));
}
if (!QGuiApplication::allWindows().isEmpty()) {
QGuiApplication::allWindows().at(0)->requestActivate();
QWindow *window = QGuiApplication::allWindows().at(0);
KWindowSystem::updateStartupId(window);
KWindowSystem::activateWindow(window);
}
});
#endif
......
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