bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
(cherry picked from commit dd74369cb7
)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
This commit is contained in:
parent
d9fc795487
commit
60586de02d
|
@ -83,7 +83,8 @@ class ViewWindow(Toplevel):
|
||||||
command=self.ok, takefocus=False)
|
command=self.ok, takefocus=False)
|
||||||
self.viewframe.pack(side='top', expand=True, fill='both')
|
self.viewframe.pack(side='top', expand=True, fill='both')
|
||||||
|
|
||||||
if modal:
|
self.is_modal = modal
|
||||||
|
if self.is_modal:
|
||||||
self.transient(parent)
|
self.transient(parent)
|
||||||
self.grab_set()
|
self.grab_set()
|
||||||
if not _utest:
|
if not _utest:
|
||||||
|
@ -91,7 +92,8 @@ class ViewWindow(Toplevel):
|
||||||
|
|
||||||
def ok(self, event=None):
|
def ok(self, event=None):
|
||||||
"""Dismiss text viewer dialog."""
|
"""Dismiss text viewer dialog."""
|
||||||
self.grab_release()
|
if self.is_modal:
|
||||||
|
self.grab_release()
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue