Skip to content

bpo-41611: IDLE: fix freezing on completion on macOS #26400

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Lib/idlelib/autocomplete_w.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ def winconfig_event(self, event):
text.see(self.startindex)
x, y, cx, cy = text.bbox(self.startindex)
acw = self.autocompletewindow
acw.update()
if platform.system().startswith('Windows'):
# On Windows an update() call is needed for the completion list
# window to be created, so that we can fetch its width and
# height. However, this is not needed on other platforms (tested
# on Ubuntu and macOS) but at one point began causing freezes on
# macOS. See issues 37849 and 41611.
acw.update()
acw_width, acw_height = acw.winfo_width(), acw.winfo_height()
text_width, text_height = text.winfo_width(), text.winfo_height()
new_x = text.winfo_rootx() + min(x, max(0, text_width - acw_width))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix IDLE sometimes freezing upon tab-completion on macOS.