The question is similar to the following: How to ignore double-clicks and detect single-clicks in C with GTK4 (< 4.10)? . It is therefore important that the program waits for the timeout and only then decides how to evaluate the click.
How this can be programmed, I have shown here:
https://stackoverflow.com/a/79159604/22768315.
Have fun programming.