mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +00:00
Reset key focus when the key focus widget is hidden (Fixes #1568)
This commit is contained in:
parent
37c85f0af4
commit
7f26843dc3
@ -21,6 +21,17 @@ void WindowBase::setVisible(bool visible)
|
|||||||
open();
|
open();
|
||||||
else if (wasVisible && !visible)
|
else if (wasVisible && !visible)
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
// This is needed as invisible widgets can retain key focus.
|
||||||
|
if (!visible)
|
||||||
|
{
|
||||||
|
MyGUI::Widget* keyFocus = MyGUI::InputManager::getInstance().getKeyFocusWidget();
|
||||||
|
while (keyFocus != mMainWidget && keyFocus != NULL)
|
||||||
|
keyFocus = keyFocus->getParent();
|
||||||
|
|
||||||
|
if (keyFocus == mMainWidget)
|
||||||
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowBase::isVisible()
|
bool WindowBase::isVisible()
|
||||||
|
Loading…
Reference in New Issue
Block a user