diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index 4894e8c3c..7b3c81819 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -109,7 +109,17 @@ void GUIModalMenu::quitMenu() // This removes Environment's grab on us Environment->removeFocus(this); m_menumgr->deletingMenu(this); + this->grab(); this->remove(); + +#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR >= 9 + // Force update hovered elements, so that GUI Environment drops previously + // grabbed elements that are not hovered anymore + Environment->forceUpdateHoveredElement(); +#endif + + this->drop(); + #ifdef HAVE_TOUCHSCREENGUI if (g_touchscreengui && g_touchscreengui->isActive() && m_touchscreen_visible) g_touchscreengui->show();