Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-15786: IDLE: Fix autocomletetion mouse click and freeze behavior #1517

Closed
wants to merge 6 commits into from
Closed

bpo-15786: IDLE: Fix autocomletetion mouse click and freeze behavior #1517

wants to merge 6 commits into from

Conversation

louisom
Copy link
Contributor

@louisom louisom commented May 9, 2017

No description provided.

@mention-bot
Copy link

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

The root cause is we destory autocompletewindow to fast,
thus tk can't focusOn widget, we should re-focus on widget
first, then destory autocompletewindow.
@louisom
Copy link
Contributor Author

louisom commented May 10, 2017

@terryjreedy This fixed the MacOS freeze and double click disappear problem, please help to take a review

@louisom louisom changed the title bpo-15786: Fix autocomletetion box mouse behavior bpo-15786: IDLE: Fix autocomletetion mouse click and freeze behavior May 10, 2017
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial formatting change.
Does not solve issue on Windows.

if self.is_active():
self.hide_window()
if self.widget == self.widget.focus_get() or not self.widget.focus_get():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd if is equivalent to 'and', and line is too long. This works and conforms to PEP8.
if (self.is_active() and
(self.widget == self.widget.focus_get()
or not self.widget.focus_get())):
self.hide_window()

@@ -241,8 +243,10 @@ def winconfig_event(self, event):
acw.wm_geometry("+%d+%d" % (new_x, new_y))

def hide_event(self, event):
# This will be trigger when focus on widget or autocompletewindow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make proper docstring, which I believe
"Hide autocomplete list if it exists and does not have focus."

@louisom
Copy link
Contributor Author

louisom commented May 11, 2017

I must admire your work in IDLE, terry. Tk has bunch of cross-platform holes. On windows it can't work is because somehow winconfig will be trigger multiple time (just like a infinity loop), and let Tk can't respond to Double-ButtonRelease.

The fix will unbind winconfig_event when we are in the windows platform to prevent this problem.

@louisom
Copy link
Contributor Author

louisom commented May 25, 2017

Close this issue and transfer to #1811

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