From 274570ddbb7c30f7e4858b75f37ff56ecc371ba1 Mon Sep 17 00:00:00 2001 From: Johnny Najera Date: Fri, 29 Nov 2019 23:06:01 +0200 Subject: [PATCH 1/9] Fixing autocomplete window doesn't appear in ubuntu 19.10 --- Lib/idlelib/autocomplete_w.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 5035e067392e5fe..a9de26a1db67f10 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -17,7 +17,7 @@ # before the default specific IDLE function KEYPRESS_SEQUENCES = ("", "", "", "", "", "", "", "", - "", "") + "", "", "") KEYRELEASE_VIRTUAL_EVENT_NAME = "<>" KEYRELEASE_SEQUENCE = "" LISTUPDATE_SEQUENCE = "" @@ -256,7 +256,7 @@ def winconfig_event(self, event): else: # place acw above current line new_y -= acw_height - acw.wm_geometry("+%d+%d" % (new_x, new_y)) + self.widget.after(1, lambda: self._update_geometry(acw, new_x, new_y)) if platform.system().startswith('Windows'): # See issue 15786. When on Windows platform, Tk will misbehave @@ -267,6 +267,9 @@ def winconfig_event(self, event): self.is_configuring = False + def _update_geometry(self, acw, x, y): + acw.wm_geometry("+%d+%d" % (x, y)) + def _hide_event_check(self): if not self.autocompletewindow: return From c47097493e2cfbd648c8d2ea741eb2998b279b62 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2019 23:44:12 +0000 Subject: [PATCH 2/9] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst diff --git a/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst b/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst new file mode 100644 index 000000000000000..529c9121e7d49cd --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst @@ -0,0 +1 @@ +Fix autocomplete window not showing on some systems because of the context in which wm_geometry is called. \ No newline at end of file From 66c9c1bf5adb3d8c97e372760937ec49ae0baef2 Mon Sep 17 00:00:00 2001 From: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com> Date: Sat, 30 Nov 2019 12:50:02 +0200 Subject: [PATCH 3/9] Update Lib/idlelib/autocomplete_w.py Co-Authored-By: Terry Jan Reedy --- Lib/idlelib/autocomplete_w.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index a9de26a1db67f10..f50819dfbfba273 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -17,7 +17,7 @@ # before the default specific IDLE function KEYPRESS_SEQUENCES = ("", "", "", "", "", "", "", "", - "", "", "") + "", "") KEYRELEASE_VIRTUAL_EVENT_NAME = "<>" KEYRELEASE_SEQUENCE = "" LISTUPDATE_SEQUENCE = "" From bdd6ddd8958ce233afbe2dcb9a7e4b50066612e2 Mon Sep 17 00:00:00 2001 From: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com> Date: Sat, 30 Nov 2019 12:51:15 +0200 Subject: [PATCH 4/9] Update Lib/idlelib/autocomplete_w.py Co-Authored-By: Terry Jan Reedy --- Lib/idlelib/autocomplete_w.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index f50819dfbfba273..fdeebc68a6ecfce 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -256,7 +256,7 @@ def winconfig_event(self, event): else: # place acw above current line new_y -= acw_height - self.widget.after(1, lambda: self._update_geometry(acw, new_x, new_y)) + self.widget.after(1, acw.wm_geometry, "+%d+%d" % (x, y)) if platform.system().startswith('Windows'): # See issue 15786. When on Windows platform, Tk will misbehave From eeba78faac8f13a79c95f6223f2e1b365ff33f16 Mon Sep 17 00:00:00 2001 From: Johnny Najera Date: Sat, 30 Nov 2019 13:34:38 +0200 Subject: [PATCH 5/9] Remove excessive whitespace --- Lib/idlelib/autocomplete_w.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index fdeebc68a6ecfce..609a0ad41e64fe6 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -256,7 +256,7 @@ def winconfig_event(self, event): else: # place acw above current line new_y -= acw_height - self.widget.after(1, acw.wm_geometry, "+%d+%d" % (x, y)) + self.widget.after(1, acw.wm_geometry, "+%d+%d" % (x, y)) if platform.system().startswith('Windows'): # See issue 15786. When on Windows platform, Tk will misbehave From 4c025b014f7de989c27b4e0d859dd8aa8a28f86c Mon Sep 17 00:00:00 2001 From: Johnny Najera Date: Sat, 30 Nov 2019 19:04:11 +0200 Subject: [PATCH 6/9] Delete unused wrapper function --- Lib/idlelib/autocomplete_w.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 609a0ad41e64fe6..04931e07d8777cc 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -267,9 +267,6 @@ def winconfig_event(self, event): self.is_configuring = False - def _update_geometry(self, acw, x, y): - acw.wm_geometry("+%d+%d" % (x, y)) - def _hide_event_check(self): if not self.autocompletewindow: return From 34fc56c9431e03478176017c8d6b9fb188f5d9a3 Mon Sep 17 00:00:00 2001 From: Johnny Najera Date: Tue, 3 Dec 2019 14:36:13 +0200 Subject: [PATCH 7/9] Fix variable names --- Lib/idlelib/autocomplete_w.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 04931e07d8777cc..46413b363248cd6 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -256,7 +256,7 @@ def winconfig_event(self, event): else: # place acw above current line new_y -= acw_height - self.widget.after(1, acw.wm_geometry, "+%d+%d" % (x, y)) + self.widget.after(1, acw.wm_geometry, "+%d+%d" % (new_x, new_y)) if platform.system().startswith('Windows'): # See issue 15786. When on Windows platform, Tk will misbehave From bb78bdf3534011d5bbdd9a4060415a52998ee775 Mon Sep 17 00:00:00 2001 From: Johnny Najera Date: Wed, 4 Dec 2019 15:56:50 +0200 Subject: [PATCH 8/9] Call update_idletasks instead --- Lib/idlelib/autocomplete_w.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 46413b363248cd6..0c2558fd91b1382 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -256,7 +256,8 @@ def winconfig_event(self, event): else: # place acw above current line new_y -= acw_height - self.widget.after(1, acw.wm_geometry, "+%d+%d" % (new_x, new_y)) + acw.wm_geometry("+%d+%d" % (new_x, new_y)) + acw.update_idletasks() if platform.system().startswith('Windows'): # See issue 15786. When on Windows platform, Tk will misbehave From cbed97121e7b53a533bb6ea15a47fbf033014c5f Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 9 Dec 2019 19:02:22 -0500 Subject: [PATCH 9/9] News item. --- Lib/idlelib/NEWS.txt | 3 +++ Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 90e7d801535f59c..304cf6375f7dce5 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-38943: Fix autocomplete windows not always appearing on some +systems. Patch by Johnny Najera. + bpo-38944: Excape key now closes IDLE completion windows. Patch by Johnny Najera. diff --git a/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst b/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst index 529c9121e7d49cd..5c9323e24678763 100644 --- a/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst +++ b/Misc/NEWS.d/next/IDLE/2019-11-29-23-44-11.bpo-38943.8pUKKs.rst @@ -1 +1,2 @@ -Fix autocomplete window not showing on some systems because of the context in which wm_geometry is called. \ No newline at end of file +Fix IDLE autocomplete windows not always appearing on some systems. +Patch by Johnny Najera.