tauri-apps / muda

Menu Utilities for Desktop Applications in Rust.
Apache License 2.0
263 stars 27 forks source link

fix: set time for GTK context menu #190

Closed rtbo closed 6 months ago

rtbo commented 6 months ago

This fixes tauri-apps/tauri#9658. I noticed somehow that setting the time field of the GDK event prevents GTK from closing the menu on right click release.

rtbo commented 6 months ago

Clippy errors are unrelated

pewsheen commented 6 months ago

Cool, It works!

How did you find out it was the time field?

pewsheen commented 6 months ago

By the way, you'll need to sign the commit and add a change log file so that it can be merged

rtbo commented 6 months ago

How did you find out it was the time field?

I made a minimal GTK app in C that mimics muda menu creation. I could reproduce the issue easily, and checked that passing the original right click event to popup_at_rect makes it behave normally. Then I played with the fields of the synthetized event to find out which one triggers the expected behavior.