Kalle Olavi Niemitalo <k...@iki.fi> writes: I debugged this now (over ssh so I could set breakpoints without causing keyboard events) and found that the keypress event gets duplicated in gcn::SDLInput::processKeyRepeat, thus causing two separate calls to the Lua code and ultimately to ToggleFullScreen.
I guess the video mode switch takes so long that Bos Wars thinks they key should repeat ... even though it has actually been released already. The easiest fix might be to make the checkbox widget change its state not on key press events but rather on key release events, which are not duplicated in this way. It would be cleaner not to generate the repeated events in the first place, but I don't know how difficult it would be to detect at that point of time that the key has already been released. It might be just a matter of asking SDL or it might not; the checkbox widget change would be easier to get reliably right.
pgpA1VnkoVW9e.pgp
Description: PGP signature