From 6d21deb6e48627922fb223a4281ade46d6d230ec Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Thu, 15 Dec 2022 00:56:11 +0100 Subject: Properly use X11 startup ids When one instance of Dolphin activates another it passes a startupId (X11) / activation token (wayland) along. On X11 this is passed using the DESKTOP_STARTUP_ID environment variable. The code tries to read that through KStartupInfo::startupId(). That doesn't work though, since Qt at startup reads the environment variable afterwards. However, it is nice enough to allow us to access it through QX11Info::nextStartupId(). Use that to read the token in the first instance and pass it to the second instance like we do on Wayland The user-facing impact of this is minimal since KStartupInfo::setNewStartupId internally falls back to KWindowSystem::forceActiveWindow when no startupId is passed. --- src/dolphinmainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.cpp') 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()); -- cgit v1.3