Bug 393646 - Spectacle uses Gnome defaults
Summary: Spectacle uses Gnome defaults
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-29 17:37 UTC by Ken K
Modified: 2018-05-10 12:08 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken K 2018-04-29 17:37:50 UTC
For whatever reason, Spectacle appears to want to use Gnome file binding defaults for Gnome, not KDE. For example, in Gnome, I have GIMP and Nautilus (Files) configured as defaults, while in KDE, I have Gwenview and Dolphin.

With Spectacle, opening the file opens in Gnome. Using "Open Containing Folder" uses Nautilus.

As far as I can tell, Spectacle is the only KDE app I have that does this.
Comment 1 null 2018-04-29 19:02:33 UTC
Are you sure you can configure different default apps for GNOME and KDE's Plasma? Isn't this supposed to use a common XDG mechanism?

Please check what "Open Containing Folder" does for you in _Gwenview_, and report back.

Also, what desktop environment are you running Spectacle in?
Comment 2 Ken K 2018-05-09 18:00:14 UTC
If I use "Open Containing Folder" in Gwenview, it does seem to open in Nautilus. However, if from the shell I use xdg-open on a folder, it opens in Dolphin. That is strange, because if I directly query xdg-mime, it definitely shows dolphin:

    $ xdg-mime query default "inode/directory"
    org.kde.dolphin.desktop

So the xdg default is definitely dolphin. And it seems like Spectacle and Gwenview are perhaps ignoring that or there's another setting that isn't clear to me that's controlling how they open files?

In terms of having different defaults between KDE Plasma and Gnome: I believe how that works is, if you login to Plasma, it puts its directories first in $XDG_CONFIG_DIRS; whereas Gnome puts its directories first. Thus whatever desktop environment you login as gets precedence for its *.desktop files, because it's first in the list. I could be mistaken about that, though at least on Ubuntu/Kubuntu, that *seems* to be the behavior as far as I can tell.

Having said that, it's possible (likely) that I'm mistaken. If I've sent this bug report to the wrong project, or if it's not really a bug at all, I'd appreciate any guidance.
Comment 3 Ken K 2018-05-09 18:03:58 UTC
Actually, viewing the source of xdg_open, it appears to branch logic directly based on DE.
Comment 4 null 2018-05-10 12:08:34 UTC
Reading your comments again, it now occurred to me that you are probably using the global shortcut to take a screenshot, and are therefore talking about the context menu of the notification, which is provided by Plasma and not by Spectacle. Nevertheless, Plasma and Gwenview are both simply using KIO::highlightInFileManager (https://api.kde.org/frameworks/kio/html/namespaceKIO.html#a793259bc6a782fe9442eba1b7c4afdd9).

The common XDG mechanism is actually a DBus service (https://www.freedesktop.org/wiki/Specifications/file-manager-interface/), which in turn is called by KIO. "grep -r /usr/share/dbus-1/ -e FileManager1" should give you more insight. For me, both Nautilus and Dolphin register themselves that way.

That said, I'm not sure why on Ubuntu DBus decides to call Nautilus and not Dolphin, while on openSUSE it works just fine for me in a Plasma session. Try asking Ubuntu (but choosing the right DBus service file might also be a generic DBus issue). For a workaround, see https://bugzilla.redhat.com/show_bug.cgi?id=1394927#c18 (don't forget to restart your session afterwards).

As for which image viewer opens, that's a different topic. You can try to see what's configured in "kcmshell5 filetypes", but again, this is not an issue which can be solved in Spectacle.