Skip to content

OpenFileManagerWindowJob: fix opening multiple instances under Wayland

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

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: Pass Qt::SingleShotConnection flag to QObject::connect() to avoid the loop.

BUG: 463931

Edited by Jin Liu

Merge request reports

Loading