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

Pressing the mouse button yields two button events #1073

Closed Voker57 closed 3 years ago

Voker57 commented 3 years ago

testcase: https://github.com/Voker57/gtk-rs-button-testcase run and click somewhere in the window

Expected output:

ButtonPress
ButtonRelease

output:

ButtonPress
ButtonPress
ButtonRelease
ButtonRelease

Tested on: Debian Sid

C testcase also included, behaves properly.

sdroege commented 3 years ago

That looks like a bug in GTK that should also be reproducible from C. That's literally just printing the event type field of the event.

Can you report that here: https://gitlab.gnome.org/GNOME/gtk/-/issues/new ? Thanks

sdroege commented 3 years ago

The C testcase behaves different so something wrong here.

sdroege commented 3 years ago

I'm not sure why but this seems to behave correctly. Your difference is that you return TRUE in the C code but Inhibit(false) in the Rust code. If you make it the same in both then they behave the same.

Voker57 commented 3 years ago

Right, thank you.