not-fl3 / macroquad

Cross-platform game engine in Rust.
Apache License 2.0
3.32k stars 324 forks source link

Buttons take multiple presses for them to activate. #524

Open Ultra-Gato opened 1 year ago

Ultra-Gato commented 1 year ago

Around 50% of the time, When I run the program. The gui buttons require multiple presses for them to activate.

How to reproduce:

use macroquad::prelude::*;
use macroquad::ui::Ui::*;
#[macroquad::main("Buttons")]
async fn main() {
   loop {
    root_ui().label(None, "hello megaui");
    if root_ui().button(None, "Push me") {
        println!("pushed");
    }
   next_frame.await();
   }
}
not-fl3 commented 1 year ago

edited formatting

I don't see the loop and next_frame().await, is it the whole reproducing example?

Ultra-Gato commented 1 year ago

I forgot a few details. Let me edit that.

With the edits, yes, That is the whole example.

macnelly commented 1 year ago

@Ultra-Gato on which platform are you?

Here is a gif where you can see 200 clicks on your button with 200 print lines on linux: output

Ultra-Gato commented 1 year ago

IMAO, It might be a problem with MacOS, I am currently using version 11.6.2

pherrymason commented 1 year ago

We've reported the same in this other issue: https://github.com/not-fl3/macroquad/issues/422 I'm also experiencing this issue, and I'm also under MacOS 12.6