Stop accepting events when we are waiting for destroy event on android.
This is to make sure that there is no eg. multiple events in single loop, so that user could open another screen before window is actually closed.
This commit is contained in:
parent
0dcaaa871a
commit
d9550fbb28
@ -856,7 +856,7 @@ namespace GUIEngine
|
||||
{
|
||||
frame++;
|
||||
if (frame == 2)
|
||||
GUIEngine::EventHandler::get()->startAcceptingEvents();
|
||||
GUIEngine::EventHandler::get()->setAcceptEvents(true);
|
||||
}
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -114,7 +114,7 @@ namespace GUIEngine
|
||||
static EventHandler* get();
|
||||
static void deallocate();
|
||||
|
||||
void startAcceptingEvents() { m_accept_events = true; }
|
||||
void setAcceptEvents(bool value) { m_accept_events = value; }
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -406,6 +406,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
|
||||
else if (selection == "quit")
|
||||
{
|
||||
#ifdef ANDROID
|
||||
GUIEngine::EventHandler::get()->setAcceptEvents(false);
|
||||
ANativeActivity_finish(global_android_app->activity);
|
||||
#else
|
||||
StateManager::get()->popMenu();
|
||||
@ -574,6 +575,7 @@ void MainMenuScreen::onDisabledItemClicked(const std::string& item)
|
||||
bool MainMenuScreen::onEscapePressed()
|
||||
{
|
||||
#ifdef ANDROID
|
||||
GUIEngine::EventHandler::get()->setAcceptEvents(false);
|
||||
ANativeActivity_finish(global_android_app->activity);
|
||||
return false;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user