Bug 515148 - Desktop icons do not always refresh after symlink target change and touch
Summary: Desktop icons do not always refresh after symlink target change and touch
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop icons & Folder View widget (other bugs)
Version First Reported In: 6.5.5
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-27 06:46 UTC by nova8x
Modified: 2026-01-27 06:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nova8x 2026-01-27 06:46:58 UTC
## SUMMARY
If the Desktop folder found at `~/Desktop` is replaced with a symlink an issue arises when changing the target of that symlink after plasmashell initializes. If the target of the symlink is changed to another folder, the contents / icons displayed on the user's desktop will not update without manually refreshing via F5 even if the target is touched.

If the symlink target is changed back to the folder it was set to during startup then the desktop icons will refresh on their own if the target is touched.

## STEPS TO REPRODUCE
1. Rename the `~/Desktop` folder to something like `Desktop1`
2. Make a symlink targeting `Desktop1` called Desktop
3. Restart plasmashell `plasmashell --replace`
4. Change the symlink target to any other folder
5. Touch the link's target and see that manual F5 is needed
6. Set the symlink back to the original target (`Desktop1`)
7. Touch `Desktop1` and see the automatic refresh occur

```bash
target=$(readlink -f $HOME/Desktop)

if [ "$target" = "${HOME}/Desktop1" ]; then
    ln -sfn $HOME/Desktop2 $HOME/Desktop
else
    ln -sfn $HOME/Desktop1 $HOME/Desktop
fi
touch $HOME/Desktop/
```

The above script demonstrates this if you have the folders `Desktop1` and `Desktop2` created under `~` and the original `Desktop` folder is not present.

## OBSERVED RESULT
The refresh of desktop icons is only triggered when targeting and touching the original target. If the current target of the symlink is not the original target then touching it will not refresh the desktop icons. Seems as though the watcher is still watching for changes on the old directory despite it no longer being displayed on the desktop.

## EXPECTED RESULT
The target of the symlink should we watched such that the changes to it are reflected on the desktop. 

## SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 32 GiB of RAM (31.2 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3070

## Additional Information
When the target of the symlink is not the same as the directory during startup, refreshing of the desktop can still be triggered by touching the original target despite it nolonger being linked to.
Comment 1 nova8x 2026-01-27 06:57:40 UTC
## Adendum to my additional info:

I updated the script to touch both directories which seems to work as a temporary solution if this bug is not fixed and others have a similar issue. Since the whatever folder is being watched is unknown and i have no interest in storing state, touching both seems to work just fine. Not sure what issues this could present if there were say 100 folders but I doubt anyone would have that many this very specific use case.

```bash
#!/bin/bash
target=$(readlink -f $HOME/Desktop)
desktop="${HOME}/Desktop"
desktop1="${HOME}/Desktop1"
desktop2="${HOME}/Desktop2"

# rm $HOME/Desktop
if [ "$target" = "$desktop1" ]; then
    ln -sfn "$desktop2" "$desktop"
else
    ln -sfn "$desktop1" "$desktop"
fi

touch "$desktop1"
touch "$desktop2"
```