[3.13] gh-154357: Fix tkinter, ttk and IDLE tests depending on the window manager (GH-154370) - #157065
Merged
serhiy-storchaka merged 2 commits intoSep 7, 2026
Merged
Conversation
…the window manager (pythonGH-154370) The window manager can take the focus from the application, ignore lift() and resize a toplevel on its own. * Hide the root window in the dialog tests, so that it does not compete for the focus. * Take the focus right before generating a key event. * Tolerate additional focus events. * Do not check focus_get() and focus_displayof() without the focus. * Resize the toplevel to fit its content in wait_until_mapped(). (cherry picked from commit 3b56438)
serhiy-storchaka
enabled auto-merge (squash)
September 7, 2026 11:51
serhiy-storchaka
disabled auto-merge
September 7, 2026 12:32
SimpleDialog makes its window transient for the master unconditionally on this branch, and a transient of a hidden window is never mapped on Windows, so that go() blocks in wait_visibility().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Manual backport of GH-154370: the cherry-pick does not apply, because this branch does not have all the tests which the original commit changes. The changes to
test_wm_stackorderare omitted -- there is no such test on this branch.The window manager can take the focus from the application, ignore
lift()and resize a toplevel on its own. Tk delivers generated keyboard events to the window which has the focus, so a test which lost the focus does not get the event at all.focus_get()andfocus_displayof()without the focus.wait_until_mapped().test_boundary_values_acceptedfails #154357