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

            Bug ID: 525455
           Summary: Flatpak KolourPaint cannot save to files on a non-home
                    filesystem via the document portal
    Classification: Applications
           Product: kolourpaint
      Version First 26.04.3
       Reported In:
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

DESCRIPTION
When using the Flathub/Flatpak version of KolourPaint on Kubuntu 26.04, saving
an image to a directory on a separate filesystem such as /data does not create
the requested output file.

Save As results in xdg-document-portal creating a temporary file named like
".xdp-image_name.png.<random>"

The file contains the correct PNG data. Manually removing the .xdp- prefix and
random suffix produces a valid PNG.

Export results in image saved in the default offered target
"/home/user/Documents/" instead of specified path in /data.

The same operation works correctly in Gwenview, so this appears to be specific
to KolourPaint's save handling when operating on a document exposed through the
XDG document portal.



STEPS TO REPRODUCE
1. Use Kubuntu 26.04.
2. Install KolourPaint 26.04.3 from Flathub.
3. Keep KolourPaint's Flatpak filesystem permissions at their defaults;
4. Have an image on a separate filesystem, for example:
"/data/mega/_temp/image.jpg"
5. Open the image in KolourPaint.
6. Use Save As (or Export), set same target directory "/data/mega/_temp", type
as PNG and any name and Save, e.g.: "/data/mega/_temp/edited.png"


OBSERVED RESULT

The requested file "/data/mega/_temp/edited.png" is not created.

In case of Save As:
A file similar to ".xdp-edited.png.RtDfIZ" is created in the destination
directory.

The temporary .xdp-* file contains the complete image data and remains present
even after KolourPaint is terminated. Renaming the .xdp-* file manually to the
intended filename produces a valid PNG.

In case of Export:
Image "edited.png" is saved to a directory which was initially offered as
default Export target "/home/user/Documents/".


EXPECTED RESULT
Image saved in requested target location "/data/mega/_temp/edited.png" and
there are no temporary files left.


SOFTWARE/OS VERSIONS
Operating System: Kubuntu 26.04 LTS
KDE Plasma Version: 6.6.6
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2
Kernel: 7.0.0-111030-tuxedo (64-bit)
Graphics Platform: Wayland
xdg-desktop-portal:      1.21.1+ds-1ubuntu3
xdg-desktop-portal-kde:  6.6.6-0ubuntu0.1



ADDITIONAL INFORMATION

Details below summarized by ChatGPT after troubleshooting Save As case. 

KolourPaint's Flatpak permissions listed below. There is no direct /data
filesystem permission.
[Context]
shared=network;ipc;
sockets=wayland;fallback-x11;cups;
devices=dri;
filesystems=home;xdg-config/kdeglobals:ro;


Nevertheless, the opened image is exposed through "/run/user/1000/doc/" by
xdg-document-portal.

In a separate verbose portal trace for a Save As operation, the temporary
output file was represented by FUSE object bac18fab7b4ac77. KolourPaint wrote
the file completely (FSYNC, FLUSH, RELEASE) and the document portal then
handled a FUSE-level RENAME from edited.png.RtDfIZ to edited.png. No
corresponding physical rename of the .xdp-* backing file was observed.

XDP: FSYNC bac18fab7b4ac77
XDP: FLUSH bac18fab7b4ac77
XDP: RELEASE bac18fab7b4ac77
XDP: LOOKUP 4:edited.png.RtDfIZ => bac18fab7b4ac77
XDP: LOOKUP 4:edited.png
XDP: LOOKUP -> error ENOENT
XDP: RENAME 4 edited.png.RtDfIZ -> 4 edited.png (flags: )


In a separate D-Bus trace of another Save As operation (edited2.png), the only
Documents.Add call returned document ID 313746eb, corresponding to the
already-open source document. No FileChooser.SaveFile and Documents.AddNamed
call for the new output file was observed.

org.freedesktop.portal.Documents.GetMountPoint
    -> /run/user/1000/doc

org.freedesktop.portal.Documents.Add
    -> 313746eb

org.freedesktop.portal.Documents.GrantPermissions
    -> org.kde.kolourpaint
    -> read, write

This may indicate that KolourPaint is performing its normal
atomic-save/temporary-file workflow directly on the document-portal FUSE path
without correctly committing/finalizing the resulting temporary document.

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

Reply via email to