A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer graphics, exploration of human-computer interaction, and more.
Create two windows, move one behind another. Put the mouse to the intersection of two windows.
On escape both are closed!
It seems that SDL is sending an extra :keydown event for all pressed keys when window regains focus.
When the first window closes, the second one is gaining focus, gets an additional :keydown event and closes.
Default behaviour
By default
sketch
will close a window on a:keydown
escape
event:Problem
OS: Linux (ubuntu) SDL version: 2.0.10
Create two windows, move one behind another. Put the mouse to the intersection of two windows. On
escape
both are closed!It seems that SDL is sending an extra
:keydown
event for all pressed keys when window regains focus. When the first window closes, the second one is gaining focus, gets an additional:keydown
event and closes.Relevant discussions
Probably this issue on github is relevant: https://github.com/libsdl-org/SDL/issues/4432
Solution?
An easy solution could be to move closing to a
:keyup
event, so that there is no additional:keydown
event for the second window.