Fixed Issue #425 (hide_window will try to show a destroyed window) #456
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.
The problem
The function
on_hide_window
is called even if the window was destroyed.More details
On line 135 we bind that function using
Keybinder.bind(...)
, but never "unbind" it. Now, since all the terminator windows are run by one python process, this key binding remains until all windows are closed. So what happens is that when the key combination for hide_window is typed,on_hide_window
is called even if the window was destroyed.The first thing I tried to do was to unbind it, but this caused all the windows to lose the binding, so that hide_window would not work anymore at all.
Solution
Simply store in a variable
isDestroyed
the value True when the window is destroyed, and do nothing ifon_hide_window
is called.