When more than one
ThreadWithProgressWindow is running, the latest (frontmost)
AlertWindow cuts all others off (cancelling the threads).
The reason is this code. The call to
isCurrentlyModal() uses the default parameter value
onlyConsiderForemostModalComponent = true, so it returns
false: Even though the
AlertWindow is still showing, it’s not the frontmost modal component. The thread then gets stopped, even though the window is still showing, and the user hasn’t pressed cancel.
It becomes more misleading when it then calls
userPressedCancel set to
true. So you get the cancel result, even though there may not even be a cancel button. I think this needs to be fixed, by simply calling
onlyConsiderForemostModalComponent = false instead.