Bug 505247 - Dragging favorited Flatpak app installed in $HOME (not systemwide) to the desktop *moves* its .desktop file and breaks it
Summary: Dragging favorited Flatpak app installed in $HOME (not systemwide) to the des...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) widget (other bugs)
Version First Reported In: 6.4.80
Platform: Other Linux
: HI major
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks: 446031
  Show dependency treegraph
 
Reported: 2025-06-05 17:38 UTC by Nate Graham
Modified: 2025-08-07 14:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: Plasma 6.4.5 with Frameworks 6.17
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2025-06-05 17:38:45 UTC
STEPS TO REPRODUCE
1. `flatpak install --user com.rafaelmardojai.Blanket`
2. Open Kicker/Kickoff/etc
3. Find Blanket in there somehow (browse list, KRunner, as a favorite; doesn't matter)
4. Drag it to the desktop


OBSERVED RESULT
A symlink to a .desktop file gets *moved* from its former location to the desktop. The symlink is broken, and now Blanket can't be found via Kickoff anymore.


EXPECTED RESULT
New symlink to the desktop file gets created, and the original remains untouched.


ADDITIONAL INFORMATION
This is a worse variant of Bug 417731. There, the user was presented with options, and selecting "Copy" produced the same broken file but did not damage the original. Here, "Move" is automatically chosen with no options provided, and moving the file (because it's read/write, because the flatpak is installed in $HOME) breaks the app.
Comment 1 TraceyC 2025-06-05 22:57:16 UTC
I tested with a flatpak install of com.rafaelmardojai.Blanket on git-master, built this morning, and can't reproduce

- Added as a favorite in kickoff, dragged that to the desktop. The .desktop file on the desktop opened Blanket - OK
- Removed that desktop shortcut. Browsed for Blanket in kickoff. Dragged it to the desktop. That shortcut worked as well - OK
Comment 2 TraceyC 2025-06-05 23:27:43 UTC
I just realized I hadn't installed with --user, Blanket had been installed previously.
Tested again after removing and re-installing with --user and then realized the desktop needs to have its layout set to Folder View.

I wasn't able to reproduce with the desktop in Desktop view:

I'm not able to drag any icon from Kickoff at all
I can drag it from Kicker, where I see a plus sign, and a widget is created on the desktop

In Folder View I can't reproduce the same problem, but different problems:

Also not able to drag any icon from the menu to the desktop using Application Launcher, the mouse doesn't appear to grab it
With Application Menu, a menu pops up asking if I want to copy / move / cancel, when dragged from favorites
   from the app list, after dropping, nothing appears on the desktop, the app is still in the menu
After switching back to App Launcher, now it looks like the icon is being dragged, but dropping it does not result in an icon on the desktop, the same as with App Menu
With Kickoff, I saw the icon with a plus marker when I was dragging. After dropping, there was no icon for Blanket on the desktop, but it was still in the menu
Comment 3 John Kizer 2025-06-16 23:50:49 UTC
For what it's worth, my experience on Fedora + git master Plasma from this morning matches TraceyC's - I could either get a failed drag-and-drop, or a menu to pop up, but not an automatic broken move.
Comment 4 Marco Martin 2025-07-23 09:56:55 UTC
To me it does the following: i drop form blanket to the desktop and the drop menu appears, asking about either copy or link the desktop file.
if i select copy, then a broken link gets created, however if i select link, a valid one gets created which can launch the application
Comment 5 Marco Martin 2025-07-23 10:13:37 UTC
and indeed, installing as user the option move here appears
Comment 6 Bug Janitor Service 2025-07-23 12:22:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5700
Comment 7 Bug Janitor Service 2025-07-23 13:14:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1943
Comment 8 Christoph Cullmann 2025-07-27 15:01:41 UTC
Git commit c313833da92c68e5208723ec09fff69a2c930729 by Christoph Cullmann, on behalf of Marco Martin.
Committed on 27/07/2025 at 15:01.
Pushed by cullmann into branch 'master'.

DnD: support possibleActions() coming from the drop event

respect the possible actions that the clients sent and
enable only those (still checking if the url can be copied or can be moved)

just always allow a link as before, as the link action is not supported by
the wayland protocol

M  +2    -1    autotests/dropjobtest.cpp
M  +6    -7    src/widgets/dropjob.cpp

https://invent.kde.org/frameworks/kio/-/commit/c313833da92c68e5208723ec09fff69a2c930729
Comment 9 Nate Graham 2025-07-27 15:14:55 UTC
Not fully fixed yet; that's only part of it.
Comment 10 Marco Martin 2025-08-07 13:00:37 UTC
Git commit fd0f410f3ad60148046a5cba53b3c1c402357442 by Marco Martin.
Committed on 07/08/2025 at 13:00.
Pushed by mart into branch 'master'.

applets/Kickoff: Ask for only copy and link to be supported

When dragging a menu entry on the desktop, it shouldn't be possible
to move it, because it would remove the entry from the menu

This makes the dataoffer wayland protocol to ask only for copy
(link is not supported by the protocol)

M  +1    -0    applets/kickoff/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/fd0f410f3ad60148046a5cba53b3c1c402357442
Comment 11 Bug Janitor Service 2025-08-07 13:01:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/3146
Comment 12 Marco Martin 2025-08-07 13:01:20 UTC
Git commit 2741ad9c007e917a54c995a01243664470dc6032 by Marco Martin.
Committed on 07/08/2025 at 13:00.
Pushed by mart into branch 'Plasma/6.4'.

applets/Kickoff: Ask for only copy and link to be supported

When dragging a menu entry on the desktop, it shouldn't be possible
to move it, because it would remove the entry from the menu

This makes the dataoffer wayland protocol to ask only for copy
(link is not supported by the protocol)


(cherry picked from commit fd0f410f3ad60148046a5cba53b3c1c402357442)

4cb76271 applets/Kickoff: Ask for only copy and link to be supported
f95653ac Applets/Kickoff: drag the actual file if it's a link
c7c76914 cit call to Utils

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +1    -0    applets/kickoff/package/contents/ui/main.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/2741ad9c007e917a54c995a01243664470dc6032
Comment 13 Marco Martin 2025-08-07 14:38:37 UTC
Git commit 9a03ad4f5674ef3c96ad7d4ac6cffe24be96918d by Marco Martin.
Committed on 07/08/2025 at 14:38.
Pushed by mart into branch 'master'.

applets/kicker: Resolve symlinks when possible

flatpak puts in its applications/ folder a relative symlink
to the desktop file starting with "../../" so when an entry from
flatpak is dragged and copied to the desktop, it will be a broken
link.

When resolving urls for ApplicationEntry and RunnerModel results,
Resolve the symlink and return an url with the actual full path of the target
Related: bug 417731

Needs https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/3115

M  +18   -1    applets/kicker/appentry.cpp
M  +26   -2    applets/kicker/runnermatchesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/9a03ad4f5674ef3c96ad7d4ac6cffe24be96918d
Comment 14 Marco Martin 2025-08-07 14:58:22 UTC
Git commit 96422b757c4f922b41e7e7963db161b486bd4b95 by Marco Martin.
Committed on 07/08/2025 at 14:38.
Pushed by mart into branch 'Plasma/6.4'.

applets/kicker: Resolve symlinks when possible

flatpak puts in its applications/ folder a relative symlink
to the desktop file starting with "../../" so when an entry from
flatpak is dragged and copied to the desktop, it will be a broken
link.

When resolving urls for ApplicationEntry and RunnerModel results,
Resolve the symlink and return an url with the actual full path of the target
Related: bug 417731

Needs https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/3115


(cherry picked from commit 9a03ad4f5674ef3c96ad7d4ac6cffe24be96918d)

370d6043 Add an Utils singleton to resolve symlinks
114d730b Apply 1 suggestion(s) to 1 file(s)
38e7f4aa move the resolve code in appentry and runnermatches

Co-authored-by: Marco Martin <notmart@gmail.com>

M  +18   -1    applets/kicker/appentry.cpp
M  +26   -2    applets/kicker/runnermatchesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/96422b757c4f922b41e7e7963db161b486bd4b95