Skip to content

Conversation

@scidfork
Copy link
Contributor

Just a couple quick fixes to some corner cases I ran across.

  1. 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.

  2. 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.

scidfork and others added 2 commits January 29, 2024 20:26
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.
@benini
Copy link
Owner

benini commented Jan 30, 2024

'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:
https://github.com/benini/scid/blob/github/tcl/end.tcl#L1191
is just before an "after 1 {}" block.
Could you please try moving the code inside that block to see if it resolves the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants