Bug 460268 - Opening file manager from Disks & Devices doesn't raise Dolphin window on Wayland
Summary: Opening file manager from Disks & Devices doesn't raise Dolphin window on Way...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Disks & Devices (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability, wayland
Depends on:
Blocks: 460318
  Show dependency treegraph
 
Reported: 2022-10-11 19:46 UTC by Nicolas Fella
Modified: 2022-10-18 16:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2022-10-11 19:46:40 UTC
STEPS TO REPRODUCE
1. Configure Dolphin to open folders in a new tab
2. Open Dolphin
2. Go to disks & devices applet
3. Click on "Open in File Manager" for some entry

OBSERVED RESULT
The folder opens in Dolphin, but the Dolphin window isn't raised

EXPECTED RESULT
The Dolphin window is raised

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99
Qt Version: 5.15.6-kde

ADDITIONAL INFORMATION

Dolphin itself doesn't support xdg-activation yet, https://invent.kde.org/system/dolphin/-/merge_requests/461 fixes that

However the applet code is missing support for it too
Comment 1 Nicolas Fella 2022-10-11 19:49:09 UTC
We use KIO::CommandLauncherJob to execute kde-open5 (good!), but we don't pass a desktop file name, so xdg-activation doesn't work.

The problem here is that we don't know* which application is going to be launched. It could be Dolphin, or Krusander, or Nautilus etc.

*we could query for the default file manager, but that requires special casing the "Open in Filemanager" action somehow
Comment 2 Nate Graham 2022-10-11 20:00:31 UTC
It almost sounds like we need something KIO::openDefaultFileManagerJob encapsulate that logic. Or even a more generic KIO::openDefaultApplicationForUrlJob?
Comment 3 Nicolas Fella 2022-10-11 20:06:13 UTC
> Or even a more generic KIO::openDefaultApplicationForUrlJob?

That's exactly what KIO::OpenUrlJob is. That can easily be used to open the file manager

The problem here is that the device action abstraction in the applet gets in the way so we probably have to work around that. That doesn't require any new jobs though
Comment 4 Nicolas Fella 2022-10-11 20:11:50 UTC
The problem is somewhat generic for all actions. It's less noticeable there because for e.g. the gweview import we don't expect single-instance behavior, but e.g. startup feedback is broken in that case.

To fix that we need to know what desktop entry should be launched for each action, so maybe we need to extend the action desktop file with that information
Comment 5 Bug Janitor Service 2022-10-11 20:41:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2206
Comment 6 Nate Graham 2022-10-15 17:11:48 UTC
Git commit 88f8af29da700f9d553371e3fbf71136ecceaf8f by Nate Graham, on behalf of Nicolas Fella.
Committed on 15/10/2022 at 16:15.
Pushed by ngraham into branch 'master'.

[applets/diskanddevices] Add xdg-activation support to device ations

We need to know what app is launched so that CommandLauncherJob can apply xdg-activation

When opening in the file manager we query what the default file manager is and use that

When invoking other actions read a new action metadata key that specifies what is launched

M  +16   -0    dataengines/hotplug/deviceserviceaction.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/88f8af29da700f9d553371e3fbf71136ecceaf8f
Comment 7 Nate Graham 2022-10-15 17:12:45 UTC
Git commit 1f6b9710e119770b948e440b2c3d5e70bfd0b58e by Nate Graham, on behalf of Nicolas Fella.
Committed on 15/10/2022 at 17:12.
Pushed by ngraham into branch 'Plasma/5.26'.

[applets/diskanddevices] Add xdg-activation support to device ations

We need to know what app is launched so that CommandLauncherJob can apply xdg-activation

When opening in the file manager we query what the default file manager is and use that

When invoking other actions read a new action metadata key that specifies what is launched


(cherry picked from commit 88f8af29da700f9d553371e3fbf71136ecceaf8f)

M  +16   -0    dataengines/hotplug/deviceserviceaction.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/1f6b9710e119770b948e440b2c3d5e70bfd0b58e
Comment 8 Patrick Silva 2022-10-18 16:39:08 UTC
This bug persists with Plasma 5.26.1 on Arch Linux.

Operating System: Arch Linux
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Graphics Platform: Wayland
Comment 9 Nate Graham 2022-10-18 16:42:49 UTC
You need the Dolphin fix as well. That hasn't been released yet IIRC.