SUMMARY If the user creates a Kate session, Kate persists the session in a desktop file created in the user's local/share/applications folder. It does so the following way: ------------------------------------------ [Desktop Action Session d4c143f004d88b7286e6f999dea9d0d7] Exec=kate -s accounting Name=accounting [Desktop Entry] Actions=Session d4c143f004d88b7286e6f999dea9d0d7; Categories=Qt;KDE;Utility;TextEditor; Comment=KDE Advanced Text Editor Exec=kate -b %U GenericName=Advanced Text Editor Icon=kate InitialPreference=9 MimeType=text/plain; Name=Kate StartupNotify=true Terminal=false Type=Application X-DBUS-ServiceName=org.kde.kate X-DBUS-StartupType=Multi X-DocPath=kate/index.html X-KDE-HasTempFileOption=true ------------------------------------------ The presence of this header before the [Desktop Entry] header (which is a violation of the desktop entry spec) causes programs which use GIO's GDesktopAppInfo to launch applications (including the Qubes OS operating system) to fail to launch the applications. The same file minus the [Desktop Actions] header works fine in the same environment: -------------------------------------- [Desktop Entry] Actions=Session d4c143f004d88b7286e6f999dea9d0d7; Categories=Qt;KDE;Utility;TextEditor; Comment=KDE Advanced Text Editor Exec=kate -b %U GenericName=Advanced Text Editor Icon=kate InitialPreference=9 MimeType=text/plain; Name=Kate StartupNotify=true Terminal=false Type=Application X-DBUS-ServiceName=org.kde.kate X-DBUS-StartupType=Multi X-DocPath=kate/index.html X-KDE-HasTempFileOption=true -------------------------------------- It is unclear at this time whether the problem is with the editor that does it, or somewhere in KDELibs that is doing the creation of the desktop file, but it's certainly a bug. OBSERVED RESULT Programs compliant with the desktop entry specification fail. Please see https://gitlab.gnome.org/GNOME/glib/issues/1987 for more information. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Latest available in Fedora 30.
Manuel I've just tested this on git master and can't see the same header as you're getting in the .desktop file. Can you please re-test and let us know if this issue is still affecting you?
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Hello. I can't test with KDE git, I'm sorry. I'm on kate-20.04.1-1.fc32.x86_64 at this time.
Moving back to REPORTED.
To reproduce: Create a Kate session however you like. Give it a name. Save the session. Exit kate. cat .local/share/applications/org.kde.kate.desktop You should see the [Desktop Action Session XXXXX] header at the top then.
Just to be perfectly clear: it's normal and okay that Kate adds such a section in the desktop file — this supports the behavior of modern desktop environments that allow context menu launches of various "application modes" (e.g. in this case "Open session X" when right-clicking on Kate in the application launcher). What's wrong is that the first section of the file MUST BE, according to the spec, [Desktop Entry].
This function is where the problematic behavior takes place: https://github.com/KDE/kate/blob/6d0dc7ddaf0ccc19f716b951aa5e2223034f854b/kate/session/katesessionmanager.cpp#L569
Get Git blame added to the Github view in the link I just pasted. On line 620, there's code to "Alphabetically sort actions". This causes "Desktop Action XXX" to appear before "Desktop Entry". That's what's causing the bug. This code should always keep "Desktop Entry" at the very beginning.
Incidentally this code was added about 2 years ago which more or less is when I started experiencing the issue.
https://github.com/KDE/kate/blame/6d0dc7ddaf0ccc19f716b951aa5e2223034f854b/kate/session/katesessionmanager.cpp#L620 the exact point to where the save behavior is broken.
Thanks for the detailed description. I sounds like you would be able to provide a patch to fix it ;) https://invent.kde.org/utilities/kate Best regards, Kåre
I, uh, would love to, but my employer forbids me from coding for others, which is something I regret having have signed. Can we enlist someone in the project to look at the fix please? Thank you! 🤗 Nov 14, 2020 15:20:42 Kåre Särs <bugzilla_noreply@kde.org>: > https://bugs.kde.org/show_bug.cgi?id=415948 > > Kåre Särs <kare.sars@iki.fi> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |kare.sars@iki.fi > > --- Comment #11 from Kåre Särs <kare.sars@iki.fi> --- > Thanks for the detailed description. > > I sounds like you would be able to provide a patch to fix it ;) > > https://invent.kde.org/utilities/kate > > Best regards, > Kåre > > -- > You are receiving this mail because: > You reported the bug.
It is still present and reproducible. Please, assign someone to this bug reported in June 2020 https://bugs.launchpad.net/ubuntu/+source/kate/+bug/1884432
(In reply to pavl.va from comment #13) > It is still present and reproducible. > Please, assign someone to this bug reported in June 2020 > https://bugs.launchpad.net/ubuntu/+source/kate/+bug/1884432 The KDE Community has no bearing on launchpad. That kate entry on launchpad is managed by the Debian Qt/KDE team.
I can confirm that this bug is present in Kate 19.12.3, the default version in Ubuntu 20.04, and is a major annoyance. The only workaround is to rewrite the desktop file manually every time a new session is saved. This is clearly an upstream issue which has nothing to do with Ubuntu.
(In reply to adrianna.pinska from comment #15) > I can confirm that this bug is present in Kate 19.12.3, the default version > in Ubuntu 20.04, and is a major annoyance. The only workaround is to rewrite > the desktop file manually every time a new session is saved. This is clearly > an upstream issue which has nothing to do with Ubuntu. Ok, so, please, at least draw attention to it by confirming on launchpad that it affects you too. Thank you.
This issue is still present in both Kate 21.04.0 and 20.12.3. On GNOME 40 it causes a very nasty bug where Kate no longer shows in the app picker after opening and closing Kate with session files. Experienced on both Manjaro and Arch GNOME. (Note: Manjaro GNOME uses additional plugins over Arch GNOME.) https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4227
Perhaps I misread the code, but the order is because KConfig will sort that output that way for writing it to the desktop file. If the [Desktop Entry] group really needs to be first, perhaps this must be handled in KDeskopFile.
I hit this bug in KDE 5.92.0 installed on the top of regular Ubuntu 22.04.2 LTS
This is still a problem in Kate 22.12.3. It makes Kate very hard to use on non-KDE desktop environments that expect desktop files to match the spec. One doesn't even need to create a session. Just starting Kate when a session exists, and closing it again, will create the faulty desktop file. I would probably have to delete all my sessions to work around this.
This bug is still present in Manjaro Gnome version as of today (december 2023). It seems quite simple to fix, but has been present for three years? Meanwhile, it seams it can help to do the job manually yourself: edit the file `~/.local/share/applications/org.kde.kate.desktop And cut all the text that is above [Desktop Entry] Then, paste that text at the end of the file, below everything. That should do the job.
Kate developers should consider add setting to prevent it to happen - something like "Do not create .desktop file for saved Kate sessions"... Meanwhile I prepared "temporary fix": ``` # Copy "proper" org.kde.kate.desktop file from global Start Menu (/usr/share/applications/) to current user Start Menu ($HOME/.local/share/applications) cp /usr/share/applications/org.kde.kate.desktop $HOME/.local/share/applications # Set "read-only" attribute on copied org.kde.kate.desktop chmod 444 $HOME/.local/share/applications/org.kde.kate.desktop ``` Tested on Fedora 40 Gnome 46 (X11) with .rpm version of Kate (kate-24.08.3-1.fc40.x86_64). Because `$HOME/.local/share/applications/org.kde.kate.desktop` is "read-only" -> Kate editor will not "destroy" it anymore with adding completely useless information about Kate sessions:)
Patch to fix this problem in the KConfig / KDesktopFile implementation: https://invent.kde.org/frameworks/kconfig/-/merge_requests/361
https://invent.kde.org/frameworks/kconfig/-/commit/8fbf4fdd9426b159011dd0da0f394e72d46e51bf
@danniello: "useless information about Kate sessions:". This information is not useless. See comments above. This information enables the session names to be listed in the GNOME context menu of the Kate application on the desktop. At the moment of this bug all session titles in the context menu are empty and listed as "unnamed". The correct solution would be to use the correct file syntax when writing to the file $HOME/.local/share/applications/org.kde.kate.desktop.
(In reply to Franz Holzinger from comment #25) > @danniello: "useless information about Kate sessions:". This information is > not useless. Very sorry for my language. You are right - possibility to open sessions via Start Menu or task icon is not useless. I was little emotional because in my opinion possibility to start Kate in GNOME is more important. It is the reason why I suggested add in Kate option to disable adding sessions into .desktop file.