1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:15:31 +00:00

Check if onOpen/onClose reversed visibility change before forwarding it to the VR GUI Manager.

This commit is contained in:
Mads Buvik Sandvei 2020-11-15 16:30:15 +01:00
parent 9e7df26f0f
commit 490d9e0086

View file

@ -62,11 +62,16 @@ void WindowBase::setVisible(bool visible)
onClose();
#ifdef USE_OPENXR
auto* vrGUIManager = MWVR::Environment::get().getGUIManager();
if (!vrGUIManager)
// May end up here before before rendering has been fully set up
return;
vrGUIManager->setVisible(this, visible);
// Check that onOpen/onClose didn't reverse the change before forwarding it
// to the VR GUI manager.
if (this->isVisible() == visible)
{
auto* vrGUIManager = MWVR::Environment::get().getGUIManager();
if (!vrGUIManager)
// May end up here before before rendering has been fully set up
return;
vrGUIManager->setVisible(this, visible);
}
#endif
}