summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-08-02 08:31:14 (GMT)
committerGitHub <noreply@github.com>2018-08-02 08:31:14 (GMT)
commit8c4a0059accb5cb33e90ec5b2f3e9dc08e2f3048 (patch)
treef54c36d9750af76eaf6104fb9bf92af88411d0d2
parent9fcfb7b010bd41d4ebaeed372df92b6962253fed (diff)
downloadcpython-8c4a0059accb5cb33e90ec5b2f3e9dc08e2f3048.zip
cpython-8c4a0059accb5cb33e90ec5b2f3e9dc08e2f3048.tar.gz
cpython-8c4a0059accb5cb33e90ec5b2f3e9dc08e2f3048.tar.bz2
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
(cherry picked from commit dd74369cb7b230b07ac3a031563406c8f2aae17f) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
-rw-r--r--Lib/idlelib/textview.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py
index e78e297..75b2470 100644
--- a/Lib/idlelib/textview.py
+++ b/Lib/idlelib/textview.py
@@ -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()