[2.7] bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)
Added missing .grab_release() calls to all places where we call .grab_set().
(cherry picked from commit 10ea9409ce
)
This commit is contained in:
parent
48c8bf21f9
commit
894940b109
|
@ -141,6 +141,7 @@ class AboutDialog(Toplevel):
|
|||
textView.view_file(self, title, fn, encoding)
|
||||
|
||||
def Ok(self, event=None):
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -1197,10 +1197,12 @@ class ConfigDialog(Toplevel):
|
|||
instance.reset_help_menu_entries()
|
||||
|
||||
def Cancel(self):
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
def Ok(self):
|
||||
self.Apply()
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
def Apply(self):
|
||||
|
|
|
@ -155,10 +155,12 @@ class GetHelpSourceDialog(Toplevel):
|
|||
# Mac Safari insists on using the URI form for local files
|
||||
self.result = list(self.result)
|
||||
self.result[1] = "file://" + path
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
def Cancel(self, event=None):
|
||||
self.result = None
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -80,10 +80,13 @@ class GetCfgSectionNameDialog(Toplevel):
|
|||
name = self.name_ok()
|
||||
if name:
|
||||
self.result = name
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
def Cancel(self, event=None):
|
||||
self.result = ''
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
if __name__ == '__main__':
|
||||
import unittest
|
||||
unittest.main('idlelib.idle_test.test_config_name', verbosity=2, exit=False)
|
||||
|
|
|
@ -15,6 +15,8 @@ class Dummy_name_dialog(object):
|
|||
name = Var()
|
||||
result = None
|
||||
destroyed = False
|
||||
def grab_release(self):
|
||||
pass
|
||||
def destroy(self):
|
||||
self.destroyed = True
|
||||
|
||||
|
|
|
@ -217,10 +217,12 @@ class GetKeysDialog(Toplevel):
|
|||
def OK(self, event=None):
|
||||
if self.advanced or self.KeysOK(): # doesn't check advanced string yet
|
||||
self.result=self.keyString.get()
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
def Cancel(self, event=None):
|
||||
self.result=''
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
def KeysOK(self):
|
||||
|
|
|
@ -39,7 +39,8 @@ class TextViewer(Toplevel):
|
|||
self.textView.insert(0.0, text)
|
||||
self.textView.config(state=DISABLED)
|
||||
|
||||
if modal:
|
||||
self.is_modal = modal
|
||||
if self.is_modal:
|
||||
self.transient(parent)
|
||||
self.grab_set()
|
||||
self.wait_window()
|
||||
|
@ -62,6 +63,8 @@ class TextViewer(Toplevel):
|
|||
frameText.pack(side=TOP,expand=TRUE,fill=BOTH)
|
||||
|
||||
def Ok(self, event=None):
|
||||
if self.is_modal:
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix unresponsiveness after closing certain windows and dialogs.
|
Loading…
Reference in New Issue