fix calling nifty.gotoScreen() with pending closePopup()
Nifty GUI is a Java Library to create OpenGL based user interfaces.
Brought to you by:
void256
When closing a popup and immediatly calling nifty.gotoScreen() afterwards this will close the popup but then Nifty gets lost somewhere and stops processing events. A way to reproduce is as simple as calling:
closePopup(); nifty.gotoScreen("screenTwo");
Nifty should handle this case internally correctly too!
59 fix calling nifty.gotoScreen() with pending closePopup() (sf.net)
nifty.closePopup() will not be executed directly but will be scheduled
for execution at the end of the next update loop. nifty.gotoScreen()
however will be executed immediately. Because of this it was possible
that calling nifty.closePopup() directly followed by a call to
nifty.gotoScreen() messed up some internals - because the current
screen already has been removed when the popup is still active
and in the process of being removed.
Now we will close all popups in nifty.gotoScreen() directly prior of
actually changing the screen to the new one.
If you use effects when the popup is closed and you need to wait for the
effects to end you should use nifty.closePopup() with an EndNotify and
call nifty.gotoScreen() when the EndNotify is called.
see this git commit for details https://github.com/void256/nifty-gui/commit/3da01269541232e11ca414cae6dc4735df034c43