gtk-rs / gtk

DEPRECATED, use https://github.com/gtk-rs/gtk3-rs repository instead!
https://gtk-rs.org/
MIT License
1.25k stars 82 forks source link

GestureDrag does not signal events #1075

Closed Voker57 closed 3 years ago

Voker57 commented 3 years ago

Sorry if I'm again inadvertently using the issues as support, but I triple-checked the testcases to be identical this time :-)

So, creating a GestureDrag on ApplicationWindow in Rust, clicking (or dragging) in the window does not trigger the drag-begin-event, but in C it does.

Testcases: https://github.com/Voker57/gtk-rs-button-testcase/tree/drag

sdroege commented 3 years ago

gesture_drag is unreffed at the end of the activate signal handler closure. As nothing else is keeping a reference to it, it is then destroyed and there's no chance for the signal to trigger anymore. You need to keep it alive somehow for as long as you need it.

In the C code you're leaking gesture_drag.