Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-38943: Fix IDLE autocomplete window not always appearing #17416
Conversation
This comment has been minimized.
This comment has been minimized.
the-knights-who-say-ni
commented
Nov 29, 2019
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
In some systems the function winconfig_event is called in a context in which wm_geometry has no effect. Calling it through widget.after(..) solves the problem on the systems I've checked (Ubuntu 19.04 to Ubuntu 19.10), without affecting its behavior on older systems (Tested on: Ubuntu 16.04, Ubuntu 18.04). Furthermore, the escape key never make it to the function keypress_event, without specifically binding it. |
Without knowing what the problem to be fixed it, I cannot judge whether the 1 millisecond delay should really fix it. I worry that calling geometry after is_configuring is set false could under some circumstances trigger another call. My deeper problem with the patch is that it is yet another kludge on what I consider a flawed design. We want the positioning function to be done once. Yet it is bound to an event that happens multiple times. The first Configure event is from 'wm_geometry("+10000+10000")' in show_window. This is not needed (and would not work on a future 16K monitor) and is done for no other popup (window.withdraw also makes a window invisible). That event is later bound to winconfig_event and we depend on that post-event binding to trigger the function. Instead, we should just call the positioning function when needed, as we do with calltips and all dialogs. Within the function, 'acw.update' triggers more Configure events (4 on Windows). So is_configuring is needed to avoid infinite recursion. On Windows, there are other Configure events, so the function is unbound from Configure events in the first call. Without all this nonsense, we don't seem to have no-show problems on other systems. If we touch this stuff, we have to manually test on all three systems, so I want to refactor to make it better. Perhaps we should make this a tooltip subclass, as with calltips. |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Nov 30, 2019
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
This comment has been minimized.
This comment has been minimized.
Hi, Regarding the 1-milisecond - It's not about 1-milisecond, but about adding the function to the mainloop queue, so it is called in a context in which it works. I have made the requested changes; please review again. P.S. |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Nov 30, 2019
Thanks for making the requested changes! @terryjreedy: please review the changes made to this pull request. |
This comment has been minimized.
This comment has been minimized.
I appears that you have not yet signed the CLA. Please do so. |
This comment has been minimized.
This comment has been minimized.
If we can't easily find the root cause for this issue, I tend to agree. I'll try testing on my Ubuntu 18.10 machine to see if this reproduces. (Ideally we'd find a better fix for this which doesn't require a rewrite.) |
@@ -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, acw.wm_geometry, "+%d+%d" % (x, y)) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JohnnyNajera
Dec 3, 2019
Author
Contributor
Of course, thank you. This happened in the last change suggestion, I didn't notice.
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Dec 1, 2019
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
This comment has been minimized.
This comment has been minimized.
Assuming you are referring to the code in the same function: It requires that the auto-complete window to be fully positioned in order to query its geometry. According to this SO answer, |
This comment has been minimized.
This comment has been minimized.
That seems like a more appropriate solution to me. (And the difference isn't just aesthetic.) |
This comment has been minimized.
This comment has been minimized.
It is in the sense we don't quite understand both of them. But fair enough, I have committed it. I have made the requested changes; please review again. P.S. Can you review my other PR? #17419 |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Dec 4, 2019
Thanks for making the requested changes! @terryjreedy, @taleinat: please review the changes made to this pull request. |
This comment has been minimized.
This comment has been minimized.
What do you say? should we merge this? @taleinat |
Requested changes were done and made obsolete by further change, which Tal also approved.
This comment has been minimized.
This comment has been minimized.
The tooltip event handler, used for calltips, uses .update_idletasks and seems to be working fine. I check all 3 current completions both auto and manual on windows and all continue to work. So I am comfortable with this -- and will check on Mac Mohave when the .rcs are released tomorrow or so. |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Dec 10, 2019
Thanks @JohnnyNajera for the PR, and @terryjreedy for merging it |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Dec 10, 2019
GH-17548 is a backport of this pull request to the 3.8 branch. |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Dec 10, 2019
GH-17549 is a backport of this pull request to the 3.7 branch. |
JohnnyNajera commentedNov 29, 2019
•
edited
https://bugs.python.org/issue38943
In some systems the function winconfig_event is called in a context in which wm_geometry has no effect.