bracket-lib icon indicating copy to clipboard operation
bracket-lib copied to clipboard

Can't close application normally

Open erlend-sh opened this issue 5 years ago • 3 comments

If I try to x-click out of a bracket (OpenGL frontend) game, nothing happens. We had to implement "esc for exit" to work around this. Is this a known problem in bracket or might we be missing some implementation detail?

I'm on MacBook Pro 2018. @jojolepro is on Linux.

erlend-sh avatar Nov 27 '20 18:11 erlend-sh

I'm also on a macbook pro and I am able to X-out of opengl window. Works fine on Catalina and Big Sur.

waldoplus avatar Dec 06 '20 18:12 waldoplus

I have this problem on Ubuntu 20.04. I think I got it when I turned on advanced input, but it might just be that I first noticed it at that time.

With advanced input turned on, in the tick function I do:

            let mut input = INPUT.lock();
            #[allow(clippy::single_match)]
            input.for_each_message(|event| match event {
                BEvent::CloseRequested => ctx.quitting = true,
                _ => (),
            });

Edit: I've tested some more.

Without advanced input turned on, it works correctly. With advanced input, I need to set ctx.quitting like above. It kind of makes sense since the game shouldn't stop until the code has got the BEvent::CloseRequested event. Since input::for_each_message doesn't have access to ctx, it can't automatically set quitting when the event is returned, if it is done in some other way, it is harder to not make the game quit if one doesn't want that.

bofh69 avatar Jan 03 '21 11:01 bofh69

Works fine if not using advanced input. :3

AnneKitsune avatar Jan 05 '21 15:01 AnneKitsune