┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/config-dolphin.h.cmake1
-rw-r--r--src/dolphinmainwindow.cpp2
-rw-r--r--src/main.cpp12
4 files changed, 22 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7642c5c67..2d7cba790 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -471,6 +471,14 @@ target_link_libraries(dolphin
KF5::Crash
)
+if (HAVE_X11)
+ if (QT_MAJOR_VERSION STREQUAL "5")
+ target_link_libraries(dolphin PRIVATE Qt5::X11Extras)
+ else()
+ target_link_libraries(dolphin PRIVATE Qt::GuiPrivate)
+ endif()
+endif()
+
include(DbusInterfaceMacros)
generate_and_install_dbus_interface(
diff --git a/src/config-dolphin.h.cmake b/src/config-dolphin.h.cmake
index 61440cf3c..af78c8622 100644
--- a/src/config-dolphin.h.cmake
+++ b/src/config-dolphin.h.cmake
@@ -3,3 +3,4 @@
#cmakedefine01 HAVE_KUSERFEEDBACK
#cmakedefine01 HAVE_PACKAGEKIT
#cmakedefine01 HAVE_TERMINAL
+#cmakedefine01 HAVE_X11
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index e4aa16d5f..f3ec70753 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -289,7 +289,7 @@ void DolphinMainWindow::activateWindow(const QString &activationToken)
if (KWindowSystem::isPlatformWayland()) {
KWindowSystem::setCurrentXdgActivationToken(activationToken);
} else {
- KStartupInfo::setNewStartupId(window()->windowHandle(), KStartupInfo::startupId());
+ KStartupInfo::setNewStartupId(window()->windowHandle(), activationToken.toUtf8());
}
KWindowSystem::activateWindow(window()->windowHandle());
diff --git a/src/main.cpp b/src/main.cpp
index a45083e40..a9b85dbcc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,6 +35,14 @@
#include <QDBusConnectionInterface>
#include <QSessionManager>
+#if HAVE_X11
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <private/qtx11extras_p.h>
+#else
+#include <QX11Info>
+#endif
+#endif
+
#ifndef Q_OS_WIN
#include <unistd.h>
#endif
@@ -181,6 +189,10 @@ int main(int argc, char **argv)
if (KWindowSystem::isPlatformWayland()) {
token = qEnvironmentVariable("XDG_ACTIVATION_TOKEN");
qunsetenv("XDG_ACTIVATION_TOKEN");
+ } else if (KWindowSystem::isPlatformX11()) {
+#if HAVE_X11
+ token = QX11Info::nextStartupId();
+#endif
}
if (Dolphin::attachToExistingInstance(urls, openFiles, splitView, QString(), token)) {