https://bugs.kde.org/show_bug.cgi?id=394670

Henrik Fehlauer <rk...@lab12.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rk...@lab12.net
         Resolution|---                         |WONTFIX
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #1 from Henrik Fehlauer <rk...@lab12.net> ---
Thanks for the report. I looked into this, here's what I've found:

KSnapshot uses "KStandardDirs::locateLocal" to provide a temporary file, and
then passes handling on to "kioexec". Cleanup (i.e. deleting the temporary
file) is done when "kioexec" exits after a delay (~3 minutes for me), which
starts as soon as the app you used to open the file exited.

In KF5, "KStandardDirs::locateLocal" is not provided by the API anymore, and
therefore Spectacle uses "QTemporaryDir". Here, cleanup is done in-process by
Spectacle via Qt. This means as soon as Spectacle closes, the temporary path
will be gone, so GIMP fails to open it.

Nevertheless, "kioexec" is still used in Spectacle via "KRun::runService", and
the deletion after the delay is still scheduled (see
https://phabricator.kde.org/source/kio/browse/master/src/kioexec/main.cpp;047f5fe921172c0890c7a14d5fff93b1310376ee$258).
However, "QTemporaryFile" already deleted the screenshot earlier.

Should we go back to the approach KSnapshot used? I'm not sure about that for a
couple of reasons:

1. Deleting the file via "kioexec" is unreliable, for example ending your
session by logging out within delay will result in the temporary file staying
around forever.
2. The temporary file handling is also used for drag-and-drop, where otherwise
no cleanup would be done.
3. "KRun" can only delete files, while Spectacle uses temporary directories to
allow natural filenames while using a unique path name (this was a design
deficiency in KSnapshot) and to provide a stable directory for saving multiple
temporary screenshots.
4. "kioexec" deleting the file on its own breaks drag-and-dropping or exporting
the image again after 3 minutes.

Therefore, I'm closing the bug as WONTFIX (sorry!). There are two workarounds
you can employ:
- Close Spectacle only after GIMP loaded the image.
- Uncheck "Ignore images" in Klipper's configure dialog, and use "Copy To
Clipboard" to be able to paste into GIMP after Spectacle was closed.

We are also working on adding more annotation/editing functions directly to
Spectacle, so hopefully GIMP will be needed less often.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to