bpo-15786: IDLE: Fix behavior when mouse click at autocompletetion window #1811
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 fix behavior on Windows, MacOS and Linux platform.
The root problem is caused by non-check for hide_event. When user click
at acw, root widget will get focusOut event, then trigger hide_window to
close the acw. It should only be hide when acw is active, and acw didn't
get focus at FocusOut event (this event bind on acw and widget), or when
widget get a ButtonPress event (this event only bind on the widget).
MacOS will freeze after double click on acw, this because when
doubleclick_event try to hide window at the end, hide_window function
destroy the whole acw, but tkinter didn't get focus back to widget. So it
should set focus on widget first, then destroy acw.
Windows can not response to double click event because the misbehavior
of Configure event, when acw is showed, tkinter will call winconfig
event multiple time, that cause tkinter can not response to double
click event. When on Windows, it will unbind Configure event when first
time get into winconfig_event to prevent multiple calls of this event.
Previous PR: #1517