[Python-checkins] cpython (merge 3.4 -> 3.5): Merge with 3.4

terry.reedy python-checkins at python.org
Wed Sep 23 03:14:15 CEST 2015


https://hg.python.org/cpython/rev/ac35626f0f14
changeset:   98193:ac35626f0f14
branch:      3.5
parent:      98188:404368d05549
parent:      98192:51b2b1a821b7
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Tue Sep 22 21:10:49 2015 -0400
summary:
  Merge with 3.4

files:
  Lib/idlelib/EditorWindow.py |  10 +++++-----
  Lib/idlelib/PyShell.py      |   8 ++++++++
  2 files changed, 13 insertions(+), 5 deletions(-)


diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -175,13 +175,13 @@
         if macosxSupport.isAquaTk():
             # Command-W on editorwindows doesn't work without this.
             text.bind('<<close-window>>', self.close_event)
-            # Some OS X systems have only one mouse button,
-            # so use control-click for pulldown menus there.
-            #  (Note, AquaTk defines <2> as the right button if
-            #   present and the Tk Text widget already binds <2>.)
+            # Some OS X systems have only one mouse button, so use
+            # control-click for popup context menus there. For two
+            # buttons, AquaTk defines <2> as the right button, not <3>.
             text.bind("<Control-Button-1>",self.right_menu_event)
+            text.bind("<2>", self.right_menu_event)
         else:
-            # Elsewhere, use right-click for pulldown menus.
+            # Elsewhere, use right-click for popup menus.
             text.bind("<3>",self.right_menu_event)
         text.bind("<<cut>>", self.cut)
         text.bind("<<copy>>", self.copy)
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1547,6 +1547,14 @@
     root.withdraw()
     flist = PyShellFileList(root)
     macosxSupport.setupApp(root, flist)
+    
+    if macosxSupport.isAquaTk():
+        # There are some screwed up <2> class bindings for text
+        # widgets defined in Tk which we need to do away with.
+        # See issue #24801.
+        root.unbind_class('Text', '<B2>')
+        root.unbind_class('Text', '<B2-Motion>')
+        root.unbind_class('Text', '<<PasteSelection>>')
 
     if enable_edit:
         if not (cmd or script):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list