bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)

This commit is contained in:
Tal Einat 2018-08-02 10:30:06 +03:00 committed by GitHub
parent 10ea9409ce
commit dd74369cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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,7 +92,8 @@ class ViewWindow(Toplevel):
def ok(self, event=None):
"""Dismiss text viewer dialog."""
self.grab_release()
if self.is_modal:
self.grab_release()
self.destroy()