Fixed a crash after closing screen keyboard when dialog window is active.

Also fixed using screen keyboard with gamepad when it's used in dialog window.
This commit is contained in:
Deve 2019-01-31 22:00:39 +01:00
parent a05889fa6a
commit 575f44a043

View File

@ -404,16 +404,22 @@ void EventHandler::sendNavigationEvent(const NavigationDirection nav, const int
{ {
Widget* w = GUIEngine::getFocusForPlayer(playerID); Widget* w = GUIEngine::getFocusForPlayer(playerID);
if (ScreenKeyboard::isActive() && if (w != NULL)
!ScreenKeyboard::getCurrent()->isMyIrrChild(w->getIrrlichtElement()))
{ {
w = NULL; if (ScreenKeyboard::isActive())
} {
if (!ScreenKeyboard::getCurrent()->isMyIrrChild(w->getIrrlichtElement()))
if (ModalDialog::isADialogActive() && {
!ModalDialog::getCurrent()->isMyIrrChild(w->getIrrlichtElement())) w = NULL;
{ }
w = NULL; }
else if (ModalDialog::isADialogActive())
{
if (!ModalDialog::getCurrent()->isMyIrrChild(w->getIrrlichtElement()))
{
w = NULL;
}
}
} }
if (w == NULL) if (w == NULL)