Menu

#59 fix calling nifty.gotoScreen() with pending closePopup()

Nifty_1.3
closed
void256
5
2014-08-14
2012-04-18
void256
No

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!

Discussion

  • void256

    void256 - 2012-09-08
    • status: open --> closed
     
  • void256

    void256 - 2012-09-08

    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