mirror of https://github.com/python/cpython
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
This commit is contained in:
parent
10ea9409ce
commit
dd74369cb7
|
@ -83,7 +83,8 @@ class ViewWindow(Toplevel):
|
|||
command=self.ok, takefocus=False)
|
||||
self.viewframe.pack(side='top', expand=True, fill='both')
|
||||
|
||||
if modal:
|
||||
self.is_modal = modal
|
||||
if self.is_modal:
|
||||
self.transient(parent)
|
||||
self.grab_set()
|
||||
if not _utest:
|
||||
|
@ -91,6 +92,7 @@ class ViewWindow(Toplevel):
|
|||
|
||||
def ok(self, event=None):
|
||||
"""Dismiss text viewer dialog."""
|
||||
if self.is_modal:
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
|
|
Loading…
Reference in New Issue