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

IDLE: completions toplevel blank on Tk Aqua 8.7 #104499

Closed
Tracked by #104568
chrstphrchvz opened this issue May 15, 2023 · 2 comments
Closed
Tracked by #104568

IDLE: completions toplevel blank on Tk Aqua 8.7 #104499

chrstphrchvz opened this issue May 15, 2023 · 2 comments
Assignees

Comments

@chrstphrchvz
Copy link
Contributor

chrstphrchvz commented May 15, 2023

# Put widgets in place
self.autocompletewindow = acw = Toplevel(self.widget)
# Put it in a position so that it is not seen.
acw.wm_geometry("+10000+10000")
# Make it float
acw.wm_overrideredirect(1)

Using wm geometry to move an overrideredirect toplevel far enough offscreen triggers a strange bug in recent Tk Aqua 8.7 (assuming it isn’t actually a macOS bug) which leaves the toplevel completely blank. I have reported it upstream: https://core.tcl-lang.org/tk/tktview/132dd3d350

However, I would like to see if IDLE can make a simple change to avoid the issue, in case Tk Aqua does not address it soon. Moving a toplevel far offscreen to hide it while configuring its contents seems improper, as opposed to something like withdrawing it. Hiding the toplevel to avoid visual artifacts is probably no longer necessary, except maybe on something sufficiently slow like X11 forwarding. IDLE also does not make a similar effort to temporarily hide the toplevel for calltips.

So I would suggest making this wm_geometry() call only when acw._windowingsystem == 'x11' or at least acw._windowingsystem != 'aqua'.

Linked PRs

@terryjreedy
Copy link
Member

I always thought moving offscreen instead of withdrawing, as done elsewhere while setting geometry, was a bit weird, but changing was not a priority before now. I think I would use query.py as an example.

@terryjreedy terryjreedy self-assigned this May 15, 2023
terryjreedy added a commit to terryjreedy/cpython that referenced this issue May 17, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2023
)

(cherry picked from commit 678bf57)

Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy added a commit to terryjreedy/cpython that referenced this issue May 18, 2023
terryjreedy added a commit that referenced this issue May 18, 2023
…104596)

gh-104499: IDLE - fix completions for tk aqua 8.7 (GH-104591)
(cherry picked from commit 678bf57)

Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy added a commit that referenced this issue May 18, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 18, 2023
(cherry picked from commit c5b670e)

Co-authored-by: Terry Jan Reedy <[email protected]>
@terryjreedy
Copy link
Member

I am a little surprised that there is no withdraw for calltips. It might have been dropped when we redid tooltip and based calltip on tooltip. So I might review the need for withdrawal by checking performance on my 2012 MacBook Air. However, in some cases, tests skip deiconify so as to minimize visual flutter.

Making windows deiconified for tests seems needed when simulating keypresses and mouse actions. I have wondered whether the latter would still work if the test window were put off screen.

terryjreedy added a commit that referenced this issue May 18, 2023
gh-104499: Fix typo. (GH-104598)
(cherry picked from commit c5b670e)

Co-authored-by: Terry Jan Reedy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants