gtk-rs / gtk3-rs

Rust bindings for GTK 3
https://gtk-rs.org
MIT License
508 stars 90 forks source link

[HELP] GTK always using `DragProtocol::Local` on Windows #734

Closed lennartkloock closed 2 years ago

lennartkloock commented 2 years ago

I tried to build a simple drag and drop application based on the drag and drop example.
I modified the example to include this:

drag_button.drag_source_set(
    gdk::ModifierType::MODIFIER_MASK,
    &[gtk::TargetEntry::new(
        "text/uri-list",
        gtk::TargetFlags::OTHER_APP,
        0,
    )],
    gdk::DragAction::COPY | gdk::DragAction::MOVE,
);

drag_button.connect_drag_failed(|_, _, r| {
    error!("Drag failed: {:?}", r);
    glib::signal::Inhibit(false)
});

The problem is that I'm always getting a NoTarget error when trying to drag the button into another application on Windows. On Linux and MacOS everything works fine. I have no idea what's happening there.

Update: I just figured out that the DragProtocol is always set to Local on Windows

sdroege commented 2 years ago

That's going to be a bug/limitation in GTK itself. Can you report it here: https://gitlab.gnome.org/GNOME/gtk/-/issues/new/

Thanks!