FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159517: Do not use ::tk::unsupported::MacWindowStyle in IDLE on Tk 9.1 by serhiy-storchaka · Pull Request #159527 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 7 additions & 5 deletions Lib/idlelib/autocomplete_w.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ def show_window(self, comp_lists, index, complete, mode, userWantsWin):
self.autocompletewindow = acw = Toplevel(self.widget)
acw.withdraw()
acw.wm_overrideredirect(1)
try:
if acw._windowingsystem == 'aqua':
# Prevent grabbing focus on macOS.
acw.tk.call("::tk::unsupported::MacWindowStyle", "style", acw._w,
"help", "noActivates")
except TclError:
pass
if acw.info_patchlevel() >= (9, 1):
acw.update_idletasks()
acw.wm_attributes(stylemask='docmodal')
else:
acw.tk.call('::tk::unsupported::MacWindowStyle', 'style',
acw._w, 'help', 'noActivates')
self.scrollbar = scrollbar = Scrollbar(acw, orient=VERTICAL)
self.listbox = listbox = Listbox(acw, yscrollcommand=scrollbar.set,
exportselection=False)
Expand Down
17 changes: 9 additions & 8 deletions Lib/idlelib/tooltip.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ def showtip(self):
self.tipwindow = tw = Toplevel(self.anchor_widget)
# show no border on the top level window
tw.wm_overrideredirect(1)
try:
# This command is only needed and available on Tk >= 8.4.0 for OSX.
# Without it, call tips intrude on the typing process by grabbing
# the focus.
tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w,
"help", "noActivates")
except TclError:
pass
if tw._windowingsystem == 'aqua':
# Without this, call tips intrude on the typing process by
# grabbing the focus.
if tw.info_patchlevel() >= (9, 1):
tw.update_idletasks()
tw.wm_attributes(stylemask='docmodal')
else:
tw.tk.call('::tk::unsupported::MacWindowStyle', 'style',
tw._w, 'help', 'noActivates')

self.position_window()
self.showcontents()
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix the completion list and the call tip grabbing the focus on macOS with
Tcl/Tk 9.1.
Loading

Back | FazBrowse Home | New Git URL