Commit 14e6fc3e authored by Martin v. Löwis's avatar Martin v. Löwis

Wait for visibility before setting a grab. Fixes #946153.

parent af529802
...@@ -119,6 +119,7 @@ class FileDialog: ...@@ -119,6 +119,7 @@ class FileDialog:
self.set_selection(default) self.set_selection(default)
self.filter_command() self.filter_command()
self.selection.focus_set() self.selection.focus_set()
self.top.wait_visibility() # window needs to be visible for the grab
self.top.grab_set() self.top.grab_set()
self.how = None self.how = None
self.master.mainloop() # Exited by self.quit(how) self.master.mainloop() # Exited by self.quit(how)
......
...@@ -64,6 +64,7 @@ class SimpleDialog: ...@@ -64,6 +64,7 @@ class SimpleDialog:
widget.deiconify() # Become visible at the desired location widget.deiconify() # Become visible at the desired location
def go(self): def go(self):
self.root.wait_visibility()
self.root.grab_set() self.root.grab_set()
self.root.mainloop() self.root.mainloop()
self.root.destroy() self.root.destroy()
......
...@@ -61,6 +61,7 @@ class Dialog(Toplevel): ...@@ -61,6 +61,7 @@ class Dialog(Toplevel):
self.buttonbox() self.buttonbox()
self.wait_visibility() # window needs to be visible for the grab
self.grab_set() self.grab_set()
if not self.initial_focus: if not self.initial_focus:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment