Dosbox dropping pressed keys (extra KEYUP events)

vogons.org discussion here: https://www.vogons.org/viewtopic.php?f=31&t=66491

SDL 1 seems to sometimes have spurious KEYUP events when SDL_FULLSCREEN is set on Linux. This can be reproduced easily enough by loading any game in dosbox (using fullscreen) that requires you to hold a button for long periods, like a racing game. Does anyone here have any intuition about why that might happen? I tried to reproduce this with a minimal program with some success, but it’s easier to reproduce in dosbox.