Skip to content

gh-162693: Restore the focus before destroying tkinter.simpledialog.Dialog - #162694

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-162693-dialog-focus-restore
Open

serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:gh-162693-dialog-focus-restore

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Like tk_dialog and tk::MessageBox, the buttons of tkinter.simpledialog.Dialog now only end the modal loop (with quit()), and _temp_grab_focus() restores the focus and the grab before destroying the dialog. Previously the dialog was destroyed first, and the window manager could move the focus elsewhere before it was restored.

The bug was introduced in #151848 and was not released, so no NEWS entry.

🤖 Generated with Claude Code

…alog.Dialog

Like tk_dialog and tk::MessageBox, the buttons now only end the modal
loop, and the focus and the grab are restored before the dialog is
destroyed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant