Move iconify to before setting alpha (#236) #428
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.
This PR is written to solve #236.
Below is an exerpt from my response the issue:
If self._toplevel is created with iconify=True, then execution is stuck until opening back the window. This is caused by src/ttkbootstrap/window.py Window.init and Toplevel.init:
Linux uses x11 display system. The Window/Toplevel was iconified before setting alpha, which causes
wait_visibility()
to get stuck until user open back the window. Hence,deiconify()
insrc/ttkbootstrap/dialogs/dialogs Dialog.build
could not be called until user open back the window.It seems like the visbility check is introduced by 2abfeb4 in response to #108 so removing that check is not an option.
This PR would swap
iconify()
and set alpha such that alpha is set when 'visbible' before iconifying. Note thaticonify()
has to be called beforeself.transient(transient)
to avoid error.