Skip to content

Conversation

@mlouielu
Copy link
Contributor

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

…ndow

This fix behavior on Windows, MacOS and Linux platform.

The root problem is cause 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 widget).

MacOS will freeze after double click on acw, this because when
doubleclick_event try to hide window at the end, hide_window function
destory whole acw, but tkinter didn't get focus back to widget. So it
should set focus on widget first, then destory acw.

Windows can not response on double click event, because the misbehavior
of Configure event, when acw is showed, tkinter will call winconfig
event multiplue time, that cause tkinter can not response to double
click event. When on Windows, it will unbind Configure event whe first
time get into winconfig_event to prevent multiple call of this event.
@mention-bot
Copy link

@mlouielu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Yhg1s, @kbkaiser and @terryjreedy to be potential reviewers.

@mlouielu
Copy link
Contributor Author

@terryjreedy, would you like to take a look about the fixed? If this work, I think we can backported to 3.6 and fixed in the 3.6.2 released

@terryjreedy terryjreedy merged commit 778b484 into python:master Jun 14, 2017
terryjreedy pushed a commit to terryjreedy/cpython that referenced this pull request Jun 14, 2017
…1811)

The root problem was non-check for hide_event. When user clicks
on autocomplete window (acw), root widget gets focusOut event, then triggers 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 widget).

MacOS  froze after double click on acw because when
doubleclick_event try to hide window at the end, hide_window function
destory whole acw, but tkinter didn't get focus back to widget. So set focus
on widget first, then destory acw.

Windows could not respond on double click event, because of the misbehavior
of Configure event.  When acw was shown, tkinter called winconfig
event multiple times.  That caused tkinter to not response to double
click event.  When on Windows, unbind Configure event first
time get into winconfig_event to prevent multiple call of this event.

(cherry picked from commit 778b484)
terryjreedy added a commit that referenced this pull request Jun 14, 2017
@python python deleted a comment from codecov bot Jun 14, 2017
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.

4 participants