gtk-rs / gtk4-rs

Rust bindings of GTK 4
https://gtk-rs.org/gtk4-rs/
MIT License
1.75k stars 168 forks source link

gtk::DragIcon::for_drag returns Widget, not DragIcon #1748

Closed felinira closed 1 month ago

felinira commented 1 month ago

gtk::DragIcon::for_drag returns a gtk::Widget. Usually we return the concrete type in such methods.

bilelmoussaoui commented 1 month ago

Should be fixed upstream https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkdragicon.c#L413

felinira commented 1 month ago

All constructor functions also return gtk::Widget and we override the return value. Like gtk::Image::from_icon_name. This is also (mostly) a constructor (apart from the fact that dragicons automatically store themselves in qdata of the drag)

bilelmoussaoui commented 1 month ago

from_icon_name

I don't see where we override those...

bilelmoussaoui commented 1 month ago

I see why, gtk_drag_icon_get_for_drag is not marked as a constructor.

bilelmoussaoui commented 1 month ago

Sent a fix upstream