Pinta icon indicating copy to clipboard operation
Pinta copied to clipboard

Crash wile trying to open a file via drag and drop

Open sadan4 opened this issue 1 month ago • 6 comments

System.InvalidCastException: Unable to cast object of type 'GObject.Object' to type 'GObject.Value'.
   at GObject.Value.Extract[T]()
   at GObject.SignalArgs.Extract[T](Value value)
   at Gtk.DropTarget.DropSignalArgs.get_Value()
   at Pinta.MainWindow.HandleDrop(DropTarget sender, DropSignalArgs args) in /build/source/Pinta/MainWindow.cs:line 598
   at GObject.ReturningSignal`3.<>c__DisplayClass11_0.<Connect>b__0(Value returnValue, Value[] parameters)
   at GObject.Closure.InternalCallback(IntPtr closure, IntPtr returnValuePtr, UInt32 nParamValues, IntPtr paramValuesData, IntPtr invocationHint, IntPtr userData)

console:

Image

error dialog

Image

Originally posted by @sadan4 in https://github.com/PintaProject/Pinta/issues/1802#issuecomment-3409150606

sadan4 avatar Nov 06 '25 06:11 sadan4

@cameronwhite like you request, I opened a separate issue.

sadan4 avatar Nov 06 '25 06:11 sadan4

Thanks! Could you also include your system / OS information, Pinta version, and installation method (e.g. flatpak / snap)?

I tried on macOS and drag & drop worked okay, but drag & drop can have more system-specific issues

cameronwhite avatar Nov 07 '25 03:11 cameronwhite

Thanks! Could you also include your system / OS information, Pinta version, and installation method (e.g. flatpak / snap)?

I tried on macOS and drag & drop worked okay, but drag & drop can have more system-specific issues

I'm running NixOS with KDE & Pinta 3.0.4 installed from Nixpkgs

sadan4 avatar Nov 10 '25 03:11 sadan4

Thanks, that is a native package, correct? (not sandboxed like flatpak or snap)

I had a Manjaro KDE VM and tested drag and drop there. In X11 sessions there seem to be issues (not specific to Pinta, e.g. https://gitlab.gnome.org/GNOME/gtk/-/issues/4562), but in Wayland sessions drag and drop from Dolphin worked fine for me. So this might also be the same issue if you're running an X11 session

cameronwhite avatar Nov 11 '25 04:11 cameronwhite

I should add, when it failed for me in an X11 session it didn't throw an exception like your case, and instead just printed errors to the console and failed to do the drag & drop

cameronwhite avatar Nov 11 '25 04:11 cameronwhite

Thanks, that is a native package, correct? (not sandboxed like flatpak or snap)

nixpkgs are not sandboxed, but are quite unique in how they handle dependencies

I had a Manjaro KDE VM and tested drag and drop there. In X11 sessions there seem to be issues (not specific to Pinta, e.g. gitlab.gnome.org/GNOME/gtk/-/issues/4562), but in Wayland sessions drag and drop from Dolphin worked fine for me. So this might also be the same issue if you're running an X11 session

yes, i am running X11 as quite a few programs i rely on do not work properly on wayland

I should add, when it failed for me in an X11 session it didn't throw an exception like your case, and instead just printed errors to the console and failed to do the drag & drop

yeah, drag and drop has never been prefect on linux, but this is the first time for me where it's crashed the app instead of just doing nothing

sadan4 avatar Nov 11 '25 06:11 sadan4