Fixed Issue #425 (hide_window will try to show a destroyed window)#456
Merged
mattrose merged 1 commit intognome-terminator:masterfrom Jul 2, 2021
Merged
Fixed Issue #425 (hide_window will try to show a destroyed window)#456mattrose merged 1 commit intognome-terminator:masterfrom
mattrose merged 1 commit intognome-terminator:masterfrom
Conversation
Member
|
This looks good, and might fix a lot of niggling issues that I haven't been able to track down. I'll pull it down and take a look at it, but assuming everything is fine I'll likely merge it in tonight. |
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.
The problem
The function
on_hide_windowis 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_windowis 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
isDestroyedthe value True when the window is destroyed, and do nothing ifon_hide_windowis called.