]> granicus.if.org Git - python/commitdiff
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
authorTal Einat <taleinat+github@gmail.com>
Thu, 2 Aug 2018 07:30:06 +0000 (10:30 +0300)
committerGitHub <noreply@github.com>
Thu, 2 Aug 2018 07:30:06 +0000 (10:30 +0300)
Lib/idlelib/textview.py

index e78e297ab9936e07429a8f24cbfe063b4c1e9907..75b24703b4c357ed6d98a2a1b2b1ffea20540ce5 100644 (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()