Bug 467080 - "Open containing folder" functionality opens the wrong file manager app when more than one is installed
Summary: "Open containing folder" functionality opens the wrong file manager app when ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 22.12.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-08 22:05 UTC by b2
Modified: 2023-03-21 07:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Video of "Open Containing Folder" process (1.52 MB, video/x-matroska)
2023-03-13 20:12 UTC, b2
Details
Flashing File Manager window (191.48 KB, image/png)
2023-03-13 20:14 UTC, b2
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b2 2023-03-08 22:05:17 UTC
SUMMARY
"Open containing folder" doesn't work if Dolphin isn't open, both when using the option from annotation window or notification.

STEPS TO REPRODUCE
1. Don't have Dolphin already open
2. Take a screen shot
3. Either click on notification's "open containing folder", or click on annotate and "open containing folder" from there

OBSERVED RESULT
Dolphin usually flashes, but won't stay open.

EXPECTED RESULT
Screen shot directory opens in Dolphin.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 36
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Works fine when Dolphin is open.
Does appear to work with other operations (e.g. clicking on notification related to moving files)
Comment 1 Nate Graham 2023-03-13 18:42:53 UTC
A few questions:

1. When this happens, what does `ps -e | grep -i dolphin` in a terminal window say?
2. Do you have any other file manager apps installed? Like Nautilus, Nemo, or Thunar?
3. What do you mean, "Dolphin usually flashes, but won't stay open"? It launches and then immediately quits? If this is what seems to be happening, can you get a backtrace of the crash using the `coredumpctl` command-line program, as detailed in https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl?

Thanks!
Comment 2 b2 2023-03-13 20:12:18 UTC
Created attachment 157241 [details]
Video of "Open Containing Folder" process
Comment 3 b2 2023-03-13 20:14:02 UTC
Created attachment 157243 [details]
Flashing File Manager window
Comment 4 b2 2023-03-13 20:18:45 UTC
(In reply to Nate Graham from comment #1)
> A few questions:
> 
> 1. When this happens, what does `ps -e | grep -i dolphin` in a terminal
> window say?
> 2. Do you have any other file manager apps installed? Like Nautilus, Nemo,
> or Thunar?
> 3. What do you mean, "Dolphin usually flashes, but won't stay open"? It
> launches and then immediately quits? If this is what seems to be happening,
> can you get a backtrace of the crash using the `coredumpctl` command-line
> program, as detailed in
> https://community.kde.org/Guidelines_and_HOWTOs/Debugging/
> How_to_create_useful_crash_reports#Retrieving_a_backtrace_using_coredumpctl?
> 
> Thanks!

Hi,

1. Output is empty
2. Yes, sorry--I should have checked before. No issues when using GNOME Files.
3. No crash is being recorded for Dolphin or anything else.

I've recorded the process and added as an attachment, as well as screen shot of the flashing window. It does not look like my usual Dolphin, but it seems to be it. GNOME Files is the only other File Manager I have.

Additionally opening the screenshot itself from Spectacle works fine. Going Tools -> Open Default Screenshots Folder also works fine.
Comment 5 Nate Graham 2023-03-14 14:10:36 UTC
If you temporarily uninstall GNOME Files, or run `dolphin --daemon` in a terminal window and then use Spectacle again, does the problem disappear?
Comment 6 b2 2023-03-14 21:58:03 UTC
Hi, 
1. Uninstalling GNOME Files didn't change anything.
2. When Dolphin --daemon is running "Open containing folder" in Spectacle works. However it opens only that folder (my Dolphin is configured to restore last used state). Additionally this msg. being displayed sometimes (only for the first time after system startup, even when I kill Dolphin it's not shown again):

kf.coreaddons: Expected a KPluginFactory, got a KIOPluginForMetaData
Comment 7 Nate Graham 2023-03-15 15:40:52 UTC
Ok, so running Dolphin daemonized is the expected generic "fix" for this issue, which is caused by a long-standing defect in the org.freedesktop.filemanager1 spec that returns the wrong file manager when more than one is installed. The fact that this keeps happening when Nautilus is uninstalled means that you have still another file manager installed, and that one is the one that gets opened when Spectacle asks for the system to open the default file manager. Unfortunately I can't tell what app it is from the picture alone. You may have to figure that out yourself.

In conclusion, there are two ways to avoid this happening:
1. Keep Dolphin running in the background in daemon mode. I believe Fedora actually does this by default.
2. Don't have any other file managers besides Dolphin open.
Comment 8 b2 2023-03-15 21:45:52 UTC
I see, many thanks for your help.
Comment 9 b2 2023-03-17 21:22:56 UTC
Just to finalize: this was Caja. Removing fixed this issue.