OsX[AppleEvents]: try to avoid some crash by delaying the function which is called

by such events...

Fixes #292
This commit is contained in:
ALONSO Laurent
2022-07-14 12:56:10 +02:00
committed by Celtic Minstrel
parent eea6166b11
commit e2a4fcc788
8 changed files with 79 additions and 6 deletions

View File

@@ -30,6 +30,10 @@
#include "tools/event_listener.hpp"
#include "tools/drawable_manager.hpp"
#ifdef __APPLE__
short menuChoiceId=-1;
#endif
/* Globals */
bool All_Done = false;
sf::RenderWindow mainPtr;
@@ -227,6 +231,12 @@ void handle_events() {
cFramerateLimiter fps_limiter;
while(!All_Done) {
#ifdef __APPLE__
if (menuChoiceId>=0) {
handle_menu_choice(eMenu(menuChoiceId));
menuChoiceId=-1;
}
#endif
while(mainPtr.pollEvent(currentEvent)) handle_one_event(currentEvent);
// Why do we have to set this to false after handling every event?