Drag and drop pictures sometimes causes a GLib exception

Bug #2027907 reported by Vitaly Novichkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Triaged
Undecided
Unassigned

Bug Description

At the recent Flatpak version of the Pinta (and at older versions too), I found the weird error: on almost every my attempt to drag a picture from the directory into the Pinta, leads an error message, however, picture gets opened normally after that. I use Linux Mint 21.1 (based on Ubuntu 22.04) and the file manager Nemo version 5.6.4.

My actions:
- Open a picture at Pinta via context menu (Open by -> Pinta).
- Making some edits on it (drawing lines with arrows of red colour).
- Saving it by Ctrl+S or by hitting the "Save" button.
- Closing it via Ctrl+W.
- Dragging another picture from the file manager into Pinta.
- Error gets popped up.
- Image gets opened in any way after error message got been closed.

EDIT: Nope, at the latest Pinta the image does NOT gets open when I drag and drop it. It gets open when I use the File -> Open menu. The drag and drop doesn't works at all now. At the in-repository version of Pinta (it's VERY old), image gets opened normally even error pops up. At Flatpak version, it fails to open.

The error message itself:
```
GLib.GException: Ошибка при получении информации о файле «/home/vitaly/.PGE_Project/thextech-adventure-of-demo/screenshots/Scr_2023-07-16_18-29-54.png»: Нет такого файла или каталога
   at GLib.FileAdapter.QueryInfo(String attributes, FileQueryInfoFlags flags, Cancellable cancellable)
   at Pinta.Core.GtkExtensions.GetDisplayName(IFile file)
   at Pinta.Core.WorkspaceManager.OpenFile(IFile file, Window parent)
```

Translation: "Error of getting information about the file '...': No such file or directory".

Tags: flatpak gtk4
Revision history for this message
Vitaly Novichkov (wohlstand-fox) wrote :
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Cameron White (cameronwhite91) wrote :

For "Nope, at the latest Pinta the image does NOT gets open", do you mean the latest flatpak build , or building Pinta from the 'master' branch?

Pinta 2.1.1 had a fix for bug 2003384 which affected drag and drop and sounds like the original issue you described with an error appearing but the file still opening successfully

The second error you described sounds maybe like a sandboxing / permissions issue where the file path can't be accessed. This might be something that's only fixed with GTK4 based on reading https://github.com/flatpak/xdg-desktop-portal/issues/99, but could be worked around by granting flatpak permissions to read the appropriate folders in the home directory?

Revision history for this message
Vitaly Novichkov (wohlstand-fox) wrote :

I mean the Flatpak version.

Revision history for this message
Vitaly Novichkov (wohlstand-fox) wrote :

I do have Pinta 2.1.1, it's from the Flatpak, and problem is here at me. The case when file gets succesfully open was a normal Pinta (but an old version), installed from the apt repisotiry of Ubuntu 22.04.

> but could be worked around by granting flatpak permissions to read the appropriate folders in the home directory?

I need to try some...

Revision history for this message
Vitaly Novichkov (wohlstand-fox) wrote :

Just now, I executed the next command:

sudo flatpak override com.github.PintaProject.Pinta --filesystem="/home/vitaly/.PGE_Project/thextech-adventure-of-demo/screenshots"

..and error has gone!

Thank you for the help!

Revision history for this message
Cameron White (cameronwhite91) wrote :

Thanks for verifying!
Yes, the version from the apt repository is likely the old GTK2 version (1.6 or 1.7) and wouldn't be sandboxed

I'm keeping this open to test the GTK4 port of Pinta (upcoming 2.2 release) as a flatpak to verify that this will work without needing extra permissions

Changed in pinta:
milestone: none → 2.2
status: New → Triaged
tags: added: flatpak gtk4
Changed in pinta:
milestone: 2.2 → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.