Bug 510287 - Application Launcher not using overridden system .desktop entries
Summary: Application Launcher not using overridden system .desktop entries
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: 6.4.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-06 05:38 UTC by m.mairleitner
Modified: 2025-10-07 20:53 UTC (History)
7 users (show)

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


Attachments
application-menu-after-edit (117.08 KB, image/png)
2025-10-06 05:38 UTC, m.mairleitner
Details
output of strace -f -o /tmp/log kbuildsycoca6 --noincremental (182.92 KB, application/zip)
2025-10-06 14:58 UTC, Cristiano Guadagnino
Details
kbuildsycoca6 log (97.75 KB, application/gzip)
2025-10-06 15:24 UTC, m.mairleitner
Details
output of QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental (5.66 KB, application/zip)
2025-10-06 15:25 UTC, Cristiano Guadagnino
Details
libreoffice-writer.desktop from ~/.local/share/applications (24.55 KB, application/x-desktop)
2025-10-06 15:26 UTC, Cristiano Guadagnino
Details
env |grep XDG_ (520 bytes, text/x-log)
2025-10-06 15:27 UTC, m.mairleitner
Details
QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental (25.93 KB, text/x-log)
2025-10-06 15:30 UTC, m.mairleitner
Details
chrome-files (5.62 KB, application/gzip)
2025-10-06 16:53 UTC, m.mairleitner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m.mairleitner 2025-10-06 05:38:23 UTC
Created attachment 185545 [details]
application-menu-after-edit

SUMMARY

I’m trying to override a global/system Desktop Entry in KDE, but my user-level changes in ~/.local/share/applications/ aren’t reflected in the KDE application launcher menu.

I made the same change on another system where it works flawlessly, so I’m a bit puzzled why it doesn’t on this machine.

STEPS TO REPRODUCE

1. Edited the desktop file with:
$ desktop-file-install --dir="$HOME/.local/share/applications" \
  --set-key=Exec \desktop-file-install --dir="$HOME/.local/share/applications" \
  --set-key=Exec \
  --set-value="/opt/google/chrome/google-chrome --disable-features=GlobalShortcutsPortal %U" \
  /usr/share/applications/google-chrome.desktop

2. The expected diff is:
$ diff /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop

108c108
< Exec=/usr/bin/google-chrome-stable %U
---
> Exec=/opt/google/chrome/google-chrome --disable-features=GlobalShortcutsPortal %U
115a116
> X-Desktop-File-Install-Version=0.28

OBSERVED RESULT

The change of the desktop file is not picked up in the KDE Application Launcher.

<see attachment>

EXPECTED RESULT

The change of the desktop file should be picked up in the KDE Application Launcher.

WHAT I'VE TRIED (unsuccessful)

    * Deleting ~/.cache/ksycoca5* and running kbuildsycoca5 --noincremental
    * Doing the same with kbuildsycoca6
    * Running update-desktop-database ~/.local/share/applications

Interestingly, if I rename the desktop entry to ~/.local/share/applications/google-chrome-test.desktop, the KDE menu updates correctly but obviously shows a duplicated entry.

This suggests the issue might be related to desktop file precedence?

RELATED ENV VARS

XDG_DATA_DIRS=/home/matthias/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20251002
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.17.0-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 32 GiB of RAM (29.0 GiB usable)
Graphics Processor: AMD Radeon 780M

REFERENCES

* https://forums.opensuse.org/t/trouble-overriding-global-desktop-entry-in-kde-plasma-6/188593
Comment 1 Cristiano Guadagnino 2025-10-06 07:15:14 UTC
I have the same behavior on my two machines running openSUSE Tumbleweed.
Here are the details of one machine, in case it helps:
Operating System: openSUSE Tumbleweed 20251004
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.17.0-1-default (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 32 GiB of RAM (31,3 GiB usable)
Graphics Processor: AMD Radeon RX 550 / 550 Series
Comment 2 David Redondo 2025-10-06 08:39:29 UTC
Is the issue only visual in this dialog or does it use the wrong Exec as well?
Comment 3 m.mairleitner 2025-10-06 09:17:16 UTC
Yes, it executes without the modified Parameters.

When i use:

> gtk-launch google-chrome.desktop

everything works as expected.
Comment 4 Harald Sitter 2025-10-06 14:44:18 UTC
I suppose /tmp/log generated by this command would be enlightening:

strace -f -o /tmp/log kbuildsycoca6 --noincremental
Comment 5 Cristiano Guadagnino 2025-10-06 14:57:34 UTC
(In reply to Harald Sitter from comment #4)
> I suppose /tmp/log generated by this command would be enlightening:
> 
> strace -f -o /tmp/log kbuildsycoca6 --noincremental

I ran the command and took a look at the log, but I did not find anything enlightening.
But, obviously, it's not easy to find something enlightening in a nearly 50k lines text file if you don0t know what you're looking for ;-)
I am attaching the file here (zipped).

Oh, one more thing... when running the command I got this output:
> strace -f -o /tmp/log kbuildsycoca6 --noincremental
kbuildsycoca6 running...
kf.service.sycoca: The menu spec file ( "" ) contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix it.
Comment 6 Cristiano Guadagnino 2025-10-06 14:58:35 UTC
Created attachment 185551 [details]
output of strace -f -o /tmp/log kbuildsycoca6 --noincremental
Comment 7 Harald Sitter 2025-10-06 15:12:58 UTC
There is an unexpected lack of chromes in that debug output.

Please attach your /usr/share/applications/google-chrome.desktop 

And, what's the output of:

env |grep XDG_
QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental
Comment 8 Cristiano Guadagnino 2025-10-06 15:24:28 UTC
(In reply to Harald Sitter from comment #7)
> There is an unexpected lack of chromes in that debug output.
> 
> Please attach your /usr/share/applications/google-chrome.desktop 
> 
> And, what's the output of:
> 
> env |grep XDG_
> QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental

My problem is not with Google Chrome, but with other applications for which the command line is not correctly reflected.
e.g. I have to use a couple environment variables to have LibreOffice correctly adapt to my HiDPI monitor, but even after adding those environment variables to the .desktop file they're not reflected in the GUI and they do not work.
If I copy the .desktop file changing its name (e.g. libreoffice-writer.desktop ==> libreoffice-writer-hidpi.desktop) I get another entry in the applications menu and this one works correctly.

I am attaching libreoffice-writer.desktop.

The output of `env |grep XDG_`:
>XDG_CONFIG_DIRS=/home/cris/.config/kdedefaults:/etc/xdg:/usr/local/etc/xdg:/usr/etc/xdg
>XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
>XDG_MENU_PREFIX=plasma-
>XDG_SEAT=seat0
>XDG_SESSION_DESKTOP=KDE
>XDG_SESSION_TYPE=wayland
>XDG_CURRENT_DESKTOP=KDE
>XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
>XDG_SESSION_CLASS=user
>XDG_VTNR=3
>XDG_SESSION_ID=3
>XDG_RUNTIME_DIR=/run/user/1000
>XDG_DATA_DIRS=/home/cris/.local/share:/home/cris/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop

The  output of `QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental` is also attached (zipped).
Comment 9 m.mairleitner 2025-10-06 15:24:30 UTC
Created attachment 185552 [details]
kbuildsycoca6 log
Comment 10 Cristiano Guadagnino 2025-10-06 15:25:07 UTC
Created attachment 185553 [details]
output of QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental
Comment 11 Cristiano Guadagnino 2025-10-06 15:26:03 UTC
Created attachment 185554 [details]
libreoffice-writer.desktop from ~/.local/share/applications
Comment 12 m.mairleitner 2025-10-06 15:27:25 UTC
Created attachment 185555 [details]
env |grep XDG_
Comment 13 m.mairleitner 2025-10-06 15:30:10 UTC
Created attachment 185556 [details]
QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental
Comment 14 m.mairleitner 2025-10-06 15:31:24 UTC
I've also added the outputs of:

> strace -f -o /tmp/log kbuildsycoca6 --noincremental
> env |grep XDG_
> QT_LOGGING_RULES=*=true kbuildsycoca6 --noincremental
Comment 15 Harald Sitter 2025-10-06 15:55:16 UTC
Very perplexing.

m.mairleitner@gmail.com can you please attach

/home/matthias/.config/menus/applications-merged/user-chrome-apps.menu
/home/matthias/.local/share/desktop-directories/chrome-apps.directory
/home/matthias/.local/share/applications/google-chrome.desktop
/usr/share/applications/com.google.Chrome.desktop
/usr/share/applications/google-chrome.desktop
Comment 16 m.mairleitner 2025-10-06 16:53:19 UTC
Created attachment 185557 [details]
chrome-files
Comment 17 m.mairleitner 2025-10-06 16:54:43 UTC
Here you go.

check out: chrome-files.tar.gz
Comment 18 Harald Sitter 2025-10-06 16:59:34 UTC
Thanks
Comment 19 Bug Janitor Service 2025-10-07 04:14:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kservice/-/merge_requests/215
Comment 20 Harald Sitter 2025-10-07 04:17:54 UTC
Unfortunately none of the existing data is showing what exactly goes wrong. The strace shows that the file is definitely being looked at, I presume it gets discarded for some reason though. I see nothing peculiar in the files you've posted and also am not able to reproduce this on my system.

I've started adding some more debug context for the next kde frameworks release. If one of you knows how to rebuild an rpm with that patch that'd be very helpful, otherwise we have to wait a month for the release and then revisit this bug.
Comment 21 m.mairleitner 2025-10-07 05:23:45 UTC
Thanks for looking into this, sitter@kde.org.

I hope to find time to do that over the weekend.

I’ll attach the new logs here and let you know.
Comment 22 Harald Sitter 2025-10-07 10:21:54 UTC
Git commit bec686d532e8c99df19cfb802198530ace5a72e6 by Harald Sitter.
Committed on 07/10/2025 at 04:13.
Pushed by sitter into branch 'master'.

kbuildsycoca: debug++

it's currently not clear why/when kservices are ignored for the sycoca.
expand debug coverage by adding some new messages and bringing back some
old ones

M  +6    -3    src/sycoca/kbuildservicefactory.cpp
M  +2    -0    src/sycoca/kbuildsycoca.cpp

https://invent.kde.org/frameworks/kservice/-/commit/bec686d532e8c99df19cfb802198530ace5a72e6