From: Martin v. Löwis Date: Sat, 18 Nov 2006 18:00:23 +0000 (+0000) Subject: Patch #1538878: Don't make tkSimpleDialog dialogs transient if X-Git-Tag: v2.6a1~2426 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c73a4a4f5170c6f9631d8f07979af8a953507933;p=python Patch #1538878: Don't make tkSimpleDialog dialogs transient if the parent window is withdrawn. This mirrors what dialog.tcl does. Will backport to 2.5. --- diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py index 4d11ce0209..02ea034b33 100644 --- a/Lib/lib-tk/tkSimpleDialog.py +++ b/Lib/lib-tk/tkSimpleDialog.py @@ -46,8 +46,13 @@ class Dialog(Toplevel): title -- the dialog title ''' Toplevel.__init__(self, parent) - self.transient(parent) + # If the master is not viewable, don't + # make the child transient, or else it + # would be opened withdrawn + if parent.winfo_viewable(): + self.transient(parent) + if title: self.title(title) diff --git a/Misc/NEWS b/Misc/NEWS index 8c9351992d..42f0b93b7f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -98,6 +98,9 @@ Core and builtins Library ------- +- Patch #1538878: Don't make tkSimpleDialog dialogs transient if + the parent window is withdrawn. + - Bug #1597824: return the registered function from atexit.register() to facilitate usage as a decorator.