Fix simulator crashing on MacOS

Event handling must happen on the main
thread for MacOS.

Not sure if button_queue_wait is the
best place for doing the SDL event
polling, but seems to work ok.

Change-Id: If928282df84bdd74e24a48afd7dbc4c4bfcc49e2
This commit is contained in:
Christian Soffke 2023-08-14 21:15:50 +02:00 committed by Solomon Peachy
parent 1745b74576
commit f1010005b0
5 changed files with 44 additions and 0 deletions

View file

@ -307,6 +307,15 @@ static bool event_handler(SDL_Event *event)
return false;
}
#ifdef __APPLE__
void handle_sdl_events(void)
{
SDL_Event event;
while(SDL_PollEvent(&event))
event_handler(&event);
}
#endif
void gui_message_loop(void)
{
SDL_Event event;