Fixed two startup/event race conditions.#162
Open
scidfork wants to merge 2 commits intobenini:githubfrom
Open
Conversation
1) Clicking on a board square at startup can no longer generate a call to playerCanMove before fics exists. 2) Clicking/holding the title bar at startup, before the spellcheck file loads, no longer results in a crash to terminal due to a progressWindow grab attempt before it is viewable. 2a) In the event that another application already has grab, also added catch to the grab call.
Owner
|
'Update idletasks' can be dangerous because it exhibits different behaviors on various operating systems. Generally, it is safe to use after making changes in a window to immediately reflect those changes. However, this approach can also be tricky. Therefore, it is better to avoid its use, especially in a function like 'progressWindow' that is utilized in numerous places. The line that loads the spellcheck files: |
f96d38b to
404bda3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just a couple quick fixes to some corner cases I ran across.
Clicking on a board square at startup could generate a call to playerCanMove before fics exists, popping up an error message. Fixed by adding a check that .fics exists first, as is done in other places within that file.
Clicking/holding the title bar at startup, before the spellcheck file loads, can no longer result in a crash to terminal due to a progressWindow grab attempt before it is viewable. There were other triggers for this same issue such as occasionally opening a menu at the right moment during startup. Kept hitting this once every so often, prior to adding the update idletasks before the grab.
2a) Finally, added a catch to the progressWindow's grab call. Found that there were still some scenarios at startup where the grab could still fail with "grab failed: another application has grab." For example, on my OS (linux) seemed that highlighting something in the terminal after starting scid would trigger this issue. Outside of startup I could not trigger this particular issue on any other grab calls.