Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--target doesn't work, gives gdk_drop_set_actions: assertion 'priv->state == GDK_DROP_STATE_NONE' failed error #24

Open
xfzv opened this issue Aug 2, 2023 · 17 comments
Labels
bug Something isn't working

Comments

@xfzv
Copy link

xfzv commented Aug 2, 2023

ripdrag --version
ripdrag 0.3.2

After trying to drag an image or an URL with --target, this error is printed and nothing happens:

ripdrag --target
(ripdrag:3732518): Gdk-CRITICAL **: 08:20:24.687: gdk_drop_set_actions: assertion 'priv->state == GDK_DROP_STATE_NONE' failed

ripdrag "$file" works fine. Note that dragon --target works fine too.

@nik012003
Copy link
Owner

Hi, thank you for reporting this. Unfortunately, I won't be able to work on it till next week.
In the meanwhile, can you share more info about the enviroment you running it on? Which Desktop Environment/WM are you using?

@nik012003 nik012003 added the bug Something isn't working label Aug 2, 2023
@xfzv
Copy link
Author

xfzv commented Aug 2, 2023

Hi, thank you for reporting this. Unfortunately, I won't be able to work on it till next week.

No worries!

In the meanwhile, can you share more info about the enviroment you running it on? Which Desktop Environment/WM are you using?

Sure.

  • Distro: Gentoo (also occurs on Arch Linux)
  • Display server: Xorg (21.1.8-r2)
  • WM: awesomeWM
  • Terminal: kitty (0.29.2) / WezTerm (20230712-072601-f4abf8fd) (occurs on both)

@huanie
Copy link
Contributor

huanie commented Aug 3, 2023

@xfzv This is a GTK/portal bug, https://gitlab.gnome.org/GNOME/gtk/-/issues/5348. I am currently looking if there is a hack for this since GTK3 applications handle this just fine.

@huanie
Copy link
Contributor

huanie commented Aug 3, 2023

@xfzv This is a GTK/portal bug, https://gitlab.gnome.org/GNOME/gtk/-/issues/5348. I am currently looking if there is a hack for this since GTK3 applications handle this just fine.

The only thing I managed to do is to be able to drop multiple files. So you'd need to open your directory and select everything there to drop it.

@xfzv
Copy link
Author

xfzv commented Aug 3, 2023

@xfzv This is a GTK/portal bug, https://gitlab.gnome.org/GNOME/gtk/-/issues/5348. I am currently looking if there is a hack for this since GTK3 applications handle this just fine.

The only thing I managed to do is to be able to drop multiple files. So you'd need to open your directory and select everything there to drop it.

Do you mean after doing some changes on your end? For now, when I try to drop multiple files from let's say Dolphin with ripdrag -t, I get these errors (multiple times):

(ripdrag:215842): Gtk-WARNING **: 17:04:13.478: (../gtk-4.10.4/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

(ripdrag:215842): Gtk-CRITICAL **: 17:04:13.478: gtk_drop_target_handle_event: assertion 'self->drop == gdk_dnd_event_get_drop (event)' failed

@huanie
Copy link
Contributor

huanie commented Aug 3, 2023

@xfzv This is a GTK/portal bug, https://gitlab.gnome.org/GNOME/gtk/-/issues/5348. I am currently looking if there is a hack for this since GTK3 applications handle this just fine.

The only thing I managed to do is to be able to drop multiple files. So you'd need to open your directory and select everything there to drop it.

Do you mean after doing some changes on your end? For now, when I try to drop multiple files from let's say Dolphin with ripdrag -t, I get these errors (multiple times):

(ripdrag:215842): Gtk-WARNING **: 17:04:13.478: (../gtk-4.10.4/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

(ripdrag:215842): Gtk-CRITICAL **: 17:04:13.478: gtk_drop_target_handle_event: assertion 'self->drop == gdk_dnd_event_get_drop (event)' failed

Yes, from my changes. https://github.com/huanie/ripdrag/tree/huan/listview

@xfzv
Copy link
Author

xfzv commented Aug 7, 2023

Still somewhat broken for me after updating to 4.0.0.

ripdrag --version
ripdrag 0.4.0ripdrag --target --and-exit
# Trying to drop some images from Dolphin
(ripdrag:2778028): Gtk-WARNING **: 14:57:29.574: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

(ripdrag:2778028): Gtk-CRITICAL **: 14:57:29.574: gtk_drop_target_handle_event: assertion 'self->drop == gdk_dnd_event_get_drop (event)' failed

[..]
(ripdrag:2778028): Gtk-WARNING **: 14:57:30.398: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

The second error is printed many times. Plus, it seems that --and-exit no longer works, even without --target. After dragging a file, I have to manually close the ripdrag window

--target now works from Firefox though.

Also noticed that the ripdrag window is completely blank now with --target. Wasn't there a text in it before? Without --target, I can still see the "X elements" text in the ripdrag window.

@huanie
Copy link
Contributor

huanie commented Aug 8, 2023

Still somewhat broken for me after updating to 4.0.0.

❯ ripdrag --version
ripdrag 0.4.0

❯ ripdrag --target --and-exit
# Trying to drop some images from Dolphin
(ripdrag:2778028): Gtk-WARNING **: 14:57:29.574: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

(ripdrag:2778028): Gtk-CRITICAL **: 14:57:29.574: gtk_drop_target_handle_event: assertion 'self->drop == gdk_dnd_event_get_drop (event)' failed

[..]
(ripdrag:2778028): Gtk-WARNING **: 14:57:30.398: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

The second error is printed many times. Plus, it seems that --and-exit no longer works, even without --target. After dragging a file, I have to manually close the ripdrag window

--target now works from Firefox though.

Also noticed that the ripdrag window is completely blank now with --target. Wasn't there a text in it before? Without --target, I can still see the "X elements" text in the ripdrag window.

must have forgotten to add the --and-exit functionality.
would you mind sharing some files (edit: I will test it on someone's wallpaper repo) and the commandline invocation to reproduce it.
There is no text if there are no files and "X elements" text should only appear when you do -A (compact view)

@huanie
Copy link
Contributor

huanie commented Aug 8, 2023

Still somewhat broken for me after updating to 4.0.0.

❯ ripdrag --version
ripdrag 0.4.0

❯ ripdrag --target --and-exit
# Trying to drop some images from Dolphin
(ripdrag:2778028): Gtk-WARNING **: 14:57:29.574: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

(ripdrag:2778028): Gtk-CRITICAL **: 14:57:29.574: gtk_drop_target_handle_event: assertion 'self->drop == gdk_dnd_event_get_drop (event)' failed

[..]
(ripdrag:2778028): Gtk-WARNING **: 14:57:30.398: (../gtk-4.10.5/gtk/gtkdroptarget.c:486):gtk_drop_target_handle_crossing: runtime check failed: (self->drop == NULL || self->drop == crossing->drop)

The second error is printed many times. Plus, it seems that --and-exit no longer works, even without --target. After dragging a file, I have to manually close the ripdrag window
--target now works from Firefox though.
Also noticed that the ripdrag window is completely blank now with --target. Wasn't there a text in it before? Without --target, I can still see the "X elements" text in the ripdrag window.

must have forgotten to add the --and-exit functionality. would you mind sharing some files (edit: I will test it on someone's wallpaper repo) and the commandline invocation to reproduce it. There is no text if there are no files and "X elements" text should only appear when you do -A (compact view)

I fixed the --and-exit.
A also downloaded dolphin, set GNOME to X11 but can't reproduce your error messages, I've only found this https://discourse.gnome.org/t/file-drag-and-drop-in-gtkmm4/10548/3 about it. So it might be a KDE bug.

About the directory problem, when any of the drop elements are directories, the drop is cancelled. @nik012003 Should there be a button to open a file picker? I know that picking directories with the file picker works.

@xfzv
Copy link
Author

xfzv commented Aug 8, 2023

There is no text if there are no files and "X elements" text should only appear when you do -A (compact view)

OK, my bad.

A also downloaded dolphin, set GNOME to X11 but can't reproduce your error messages, I've only found this https://discourse.gnome.org/t/file-drag-and-drop-in-gtkmm4/10548/3 about it. So it might be a KDE bug.

It works just fine with dragon here (with Dolphin).

--target now works from Firefox though.

Spoke too soon. Dragging URLs from Firefox (from the URL bar or from any web page) doesn't work with ripdrag while it does with dragon. Dragging an image from Firefox (opened in a new tab) works, but dragging the image's URL doesn't. Likewise, works fine with dragon.

@huanie
Copy link
Contributor

huanie commented Aug 8, 2023

There is no text if there are no files and "X elements" text should only appear when you do -A (compact view)

OK, my bad.

A also downloaded dolphin, set GNOME to X11 but can't reproduce your error messages, I've only found this https://discourse.gnome.org/t/file-drag-and-drop-in-gtkmm4/10548/3 about it. So it might be a KDE bug.

It works just fine with dragon here (with Dolphin).

--target now works from Firefox though.

Spoke too soon. Dragging URLs from Firefox (from the URL bar or from any web page) doesn't work with ripdrag while it does with dragon. Dragging an image from Firefox (opened in a new tab) works, but dragging the image's URL doesn't. Likewise, works fine with dragon.

Alright I will take a look at implementing dragging URLs during weekend, with the the errors I cannot help.

@nik012003
Copy link
Owner

About the directory problem, when any of the drop elements are directories, the drop is cancelled. @nik012003 Should there be a button to open a file picker? I know that picking directories with the file picker works.

Mh, maybe we should have a button that is both a drag target (at the top of the list) and that by clicking it , it opens the file picker.

For the URLs, I think I know how to implement it, will try doing it later today

@huanie
Copy link
Contributor

huanie commented Aug 12, 2023

There is a pull request (#28) for dropping files from the web but dropping URLs can't work at the moment because of a regression in GTK (tracked here https://gitlab.gnome.org/GNOME/gtk/-/issues/6020).

@xfzv
Copy link
Author

xfzv commented Aug 14, 2023

Trying out #28 after updating to 4.0.1 (dragging some URLs from Firefox):

ripdrag --target --and-exit
https://trisquel.info/files/screenshots/t10-office_0.jpg
Operation not supported

(ripdrag:1976395): Gdk-CRITICAL **: 21:48:05.611: gdk_drop_set_actions: assertion 'priv->state == GDK_DROP_STATE_NONE' failed
https://trisquel.info/files/screenshots/t10-office_0.jpg
Operation not supported

(ripdrag:1976395): Gdk-CRITICAL **: 21:48:46.566: gdk_drop_set_actions: assertion 'priv->state == GDK_DROP_STATE_NONE' failed
https://github.com/nik012003/ripdrag/issues/24
Operation not supported

Despite the two errors, it works I guess? However, the ripdrag window stays open despite using --and-exit. Does it mean none of the drops was considered successful?

--and-exit without --target works fine on my end.

@nik012003
Copy link
Owner

nik012003 commented Aug 14, 2023 via email

@nik012003
Copy link
Owner

Okay, fixed the --and-exit behaviour. I noticed that most things work on firefox running on X, while dragging urls is mostly broken on firefox on Wayland :/
I compared the code to the nautilus' drop_target implementation but couldn't find any meaningful differences. But it does work on nautilus, so there's gotta be something going on there...

@xfzv
Copy link
Author

xfzv commented Aug 15, 2023

Can confirm --and-exit works fine with --target now after updating to 4.0.2 (still dragging from Firefox). I'm using X11, cannot comment on Wayland.

ripdrag --target --and-exit
https://www.gnu.org/
Operation not supported

It seems very erratic indeed, it doesn't work at all with Tor Browser for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants