Bug 526111 - "Save" stores image in wrong path
Summary: "Save" stores image in wrong path
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 6.7.5
Platform: CachyOS Linux
: NOR major
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-09-23 06:09 UTC by Grim E. Ton
Modified: 2026-10-19 16:51 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grim E. Ton 2026-09-23 06:09:12 UTC
DESCRIPTION

After taking a screenshot and saving the image via "Save as..." a later click on "Save" stores the image in the default folder and does NOT overwrite the image where it was stored in the first place.

STEPS TO REPRODUCE
1. Take screenshot
2. Click "Save as..."
3. Pick your desktop
4. Save image on desktop
5. See the application opening saying "Image was stored as ... "
6. Hover with the mouse over the name of the image
7. See the path to your desktop in the tooltip
8. Modify the image. e.g. black something out
9. Click on the "Save" diskette icon in the upper left
10. See the application writing "Image was stored as...." at the top


OBSERVED RESULT
11. Hover over the image's name and see the path now being changed to the default screenshot folder

EXPECTED RESULT
11. The image on desktop gets overwritten.

The "Save" button usually means store the new version of the file in the location of the file. If you want to change the name or the path, you usually have to pick "Save as...".

SOFTWARE/OS VERSIONS
Operating System (available in the Info Center app, or by running `kinfo` in a terminal window):
Operating System: CachyOS Linux 
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
Kernel Version: 7.2.6-1-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3080
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B550 AORUS PRO V2

ADDITIONAL INFORMATION

If there are questions, feel free to ask.

KR,

G.
Comment 1 Bug Janitor Service 2026-10-14 13:15:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/spectacle/-/merge_requests/599
Comment 2 Noah Davis 2026-10-19 16:28:01 UTC
Git commit c6c39e7753112a66e9109d1ab946a9ecdcb9587c by Noah Davis, on behalf of Mohanraj Velayutham.
Committed on 19/10/2026 at 16:27.
Pushed by ndavis into branch 'master'.

SpectacleCore: update current saved image URL so Save overwrites file after Save As

## Summary

After saving a screenshot using "Save As..." or "Save", subsequent clicks on "Save" (or pressing Ctrl+S) would save into the default screenshot directory with a newly generated timestamp instead of overwriting the file that was just saved.

## Root Cause

`SpectacleWindow::save()` calls `ExportManager::exportImage(Save, SpectacleCore::instance()->outputUrl())`. However, `m_editExistingUrl` was never set when saving completed, leaving `outputUrl()` empty. When `exportImage()` received an empty URL, it fell back to `getAutosaveFilename()`, creating a new timestamped file in the default directory.

## Solution

- Update `m_editExistingUrl` to `url` in `SpectacleCore::onImageExported` when `actions & AnySave`, and clear `m_outputUrl`.
- Clear `m_editExistingUrl` whenever a new screenshot capture starts so fresh captures do not overwrite previous images.
- Pass `outputUrl()` in `SpectacleWindow::saveAs()` and pre-fill the dialog with the existing filename when available.

FIXED-IN: 6.8.1

M  +4    -1    src/ExportManager.cpp
M  +2    -1    src/Gui/SpectacleWindow.cpp
M  +12   -6    src/SpectacleCore.cpp

https://invent.kde.org/plasma/spectacle/-/commit/c6c39e7753112a66e9109d1ab946a9ecdcb9587c
Comment 3 Noah Davis 2026-10-19 16:51:13 UTC
Git commit 61f92b9c4ffdea80b22df94005620f960fdc0877 by Noah Davis.
Committed on 19/10/2026 at 16:28.
Pushed by ndavis into branch 'Plasma/6.8'.

SpectacleCore: update current saved image URL so Save overwrites file after Save As

## Summary

After saving a screenshot using "Save As..." or "Save", subsequent clicks on "Save" (or pressing Ctrl+S) would save into the default screenshot directory with a newly generated timestamp instead of overwriting the file that was just saved.

## Root Cause

`SpectacleWindow::save()` calls `ExportManager::exportImage(Save, SpectacleCore::instance()->outputUrl())`. However, `m_editExistingUrl` was never set when saving completed, leaving `outputUrl()` empty. When `exportImage()` received an empty URL, it fell back to `getAutosaveFilename()`, creating a new timestamped file in the default directory.

## Solution

- Update `m_editExistingUrl` to `url` in `SpectacleCore::onImageExported` when `actions & AnySave`, and clear `m_outputUrl`.
- Clear `m_editExistingUrl` whenever a new screenshot capture starts so fresh captures do not overwrite previous images.
- Pass `outputUrl()` in `SpectacleWindow::saveAs()` and pre-fill the dialog with the existing filename when available.

FIXED-IN: 6.8.1


(cherry picked from commit c6c39e7753112a66e9109d1ab946a9ecdcb9587c)

15f6f337 SpectacleCore: update current saved image URL so Save overwrites file after Save As

Co-authored-by: Mohanraj Velayutham <mohanrajvelayutham08@gmail.com>

M  +4    -1    src/ExportManager.cpp
M  +2    -1    src/Gui/SpectacleWindow.cpp
M  +12   -6    src/SpectacleCore.cpp

https://invent.kde.org/plasma/spectacle/-/commit/61f92b9c4ffdea80b22df94005620f960fdc0877