From 3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 25 Apr 2021 13:07:58 +0300 Subject: bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by window managers on macOS and X Window (#25187) --- Lib/idlelib/query.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Lib/idlelib/query.py') diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index 015fc7ade4..fefa5aac1b 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -28,6 +28,7 @@ from tkinter import Toplevel, StringVar, BooleanVar, W, E, S from tkinter.ttk import Frame, Button, Entry, Label, Checkbutton from tkinter import filedialog from tkinter.font import Font +from tkinter.simpledialog import _setup_dialog class Query(Toplevel): """Base class for getting verified answer from a user. @@ -60,13 +61,8 @@ class Query(Toplevel): if not _utest: # Otherwise fail when directly run unittest. self.grab_set() - windowingsystem = self.tk.call('tk', 'windowingsystem') - if windowingsystem == 'aqua': - try: - self.tk.call('::tk::unsupported::MacWindowStyle', 'style', - self._w, 'moveableModal', '') - except: - pass + _setup_dialog(self) + if self._windowingsystem == 'aqua': self.bind("", self.cancel) self.bind('', self.cancel) self.protocol("WM_DELETE_WINDOW", self.cancel) -- cgit v1.2.1