[issue15786] IDLE code completion window can hang or misbehave with mouse

Louie Lu report at bugs.python.org
Tue May 9 09:05:22 EDT 2017


Louie Lu added the comment:

The reason why click on listbox will disappear is because we bind HIDE_VIRTUAL_EVENT with <focusOut> on widget.text. When click on listbox, it will focusOut the widget.text then focusOn listbox, thus trigger the hide process.

The reason why click on listbox and move the cursor out of box, then click will freeze IDLE cursor, it because tk will generate three event:  FocusOut, FocusOut, and ButtonPress:


hidell <FocusOut event> generated by:  .!listedtoplevel.!frame.text.!toplevel2.!listbox focus on:  None
hidell <FocusOut event> generated by:  .!listedtoplevel.!frame.text.!toplevel2 focus on:  None
prove <ButtonPress event num=1 x=130 y=390> generated by:  .!listedtoplevel.!frame.text focus on:  .!listedtoplevel.!frame.text

Becase we bind HIDE process on widget.text, it will then trigger hide_window, and at the same time, FoucsOut event is still on the half-way, and then the listbox is destory and reset to None, I think this is why it will freeze until re-focus on IDEL.


Attach PR solve this problem, it re-bind the HIDE process from widget.text to listbox, thus it will not trigger some race-contidion when destroying autocompletewindow.

----------
nosy: +louielu

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15786>
_______________________________________


More information about the Python-bugs-list mailing list