Skip to content

OpenFileManagerWindowJob: fix opening multiple instances under Wayland [KF5]

Jin Liu requested to merge genericity/kio:work/fix-multi-new-window-kf5 into kf5

The Problem: Under wayland, when there's only one Dolphin window, "Show Target" in Dolphin's right click menu opens multiple duplicate Dolphin windows.

The Cause: DolphinMainWindow::showTarget => KIO::OpenFileManagerWindowJob::highlightInFileManager => KWindowSystem::requestXdgActivationToken => on KWindowSystem::xdgActivationTokenArrived signal => dbus call org.freedesktop.FileManager1 ShowItems => Dolphin::DBusInterface::ShowItems => Dolphin::openNewWindow => KIO::ApplicationLauncherJob => KIO::KProcessRunner => Calls KWindowSystem::requestXdgActivationToken under Wayland. Loop.

The Fix: Call QObject::disconnect() first in the slot to disconnect the signal.

BUG: 463931

Merge request reports