Skip to content

right-mouse click in IDLE on Mac doesn't work #68989

Closed

Description

@roseman
mannequin
BPO 24801
Nosy @terryjreedy, @ronaldoussoren, @ned-deily, @roseman, @serhiy-storchaka
Files
  • macpopup.patch
  • macpopup-revised.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-09-23.01:22:33.755>
    created_at = <Date 2015-08-06.01:36:03.546>
    labels = ['expert-IDLE', 'type-bug']
    title = "right-mouse click in IDLE on Mac doesn't work"
    updated_at = <Date 2015-09-23.01:22:33.753>
    user = 'https://github.com/roseman'

    bugs.python.org fields:

    activity = <Date 2015-09-23.01:22:33.753>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-09-23.01:22:33.755>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2015-08-06.01:36:03.546>
    creator = 'markroseman'
    dependencies = []
    files = ['40148', '40208']
    hgrepos = []
    issue_num = 24801
    keywords = ['patch']
    message_count = 9.0
    messages = ['248092', '248213', '248215', '248232', '248569', '248587', '248588', '248792', '251387']
    nosy_count = 5.0
    nosy_names = ['terry.reedy', 'ronaldoussoren', 'ned.deily', 'markroseman', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24801'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6']

    Activity

    1. roseman commented on Aug 6, 2015

      rosemanmannequin
      MannequinAuthor

      For popup menus, control-click works, but right-click on mouse buttons that support it, doesn't work.

      This is a followup to bpo-10404, last addressed in 2010.

      As noted there, right click behaviour should be supported.

      The right click Tk text bindings on Mac (which is B2) seem to bind both to the virtual 'PasteSelection' event, and also to fast-scroll through a large file is you click and drag with the right mouse button. Both of these are blatant problems with Tk's text.tcl.

      The issue when trying to fix this before was when a B2 (context menu) binding was added to the text widget, both that and the bogus B2 bindings fired. This is because Tk can fire multiple bindings for a widget (default is bindings for the widget itself, the widget's toplevel, the widget's class, and 'all').

      There is a way to short-circuit this in Tcl (basically the widget-specific binding calls 'break', which prevents the others from firing). The simpler alternative is probably just redefining the alternative class-level (Text) bindings.

      In other words, yeah, this should be pretty easily fixable.

    2. terryjreedy commented on Aug 7, 2015

      @terryjreedy
      Member

      From your description, I an not sure what it is that does not work.

    3. roseman commented on Aug 7, 2015

      rosemanmannequin
      MannequinAuthor

      If you have your mouse set up to have two buttons, right-clicking in the editor window doesn't bring up the context menu it's supposed to.

    4. roseman commented on Aug 7, 2015

      rosemanmannequin
      MannequinAuthor

      Have attached macpopup.patch which removes the incorrect Tk behaviour and makes it so that right click on Mac will bring up the context menu as appropriate.

    5. serhiy-storchaka commented on Aug 14, 2015

      @serhiy-storchaka
      Member

      Looks as right button on Mac corresponds to middle button on X Window (paste selection and scroll if moved). This behavior is standard for all Tk applications. I don't think we should break this.

    6. roseman commented on Aug 14, 2015

      rosemanmannequin
      MannequinAuthor

      There is no notion of middle button on Mac, hence right button is B2. It's documented. Current Tk 8.6 has even removed the <<PasteSelection>> binding from B2 on Aqua because of this (I've filed a Tk bug report to backport this to 8.5). 8.6 also defines a <<ContextMenu>> virtual event, which on Mac is tied to B2.

      Mac UI guidelines define use of 'right button' (when available) to be used for context menu clicks.

      So yeah, we should change this. :-)

    7. serhiy-storchaka commented on Aug 14, 2015

      @serhiy-storchaka
      Member

      Ah, so this is a workaround of 8.5- bug. Then looks reasonable to me.

      Added comments on Rietveld.

    8. roseman commented on Aug 18, 2015

      rosemanmannequin
      MannequinAuthor

      Have attached macpopup-revised.patch, incorporating Serhiy's very helpful suggestions. Unless there are any other thoughts, this one is probably ready to go.

    9. terryjreedy commented on Sep 23, 2015

      @terryjreedy
      Member

      Serhiy, thanks for the review. I bungled the issue number on the commit message, so here are the commit notices. Will correct for NEWS.

      New changeset b79dd0d7dc98 by Terry Jan Reedy in branch '2.7':
      Issue bpo-24570: Right-click for context menus now work on Mac Aqual also.
      https://hg.python.org/cpython/rev/b79dd0d7dc98

      New changeset 51b2b1a821b7 by Terry Jan Reedy in branch '3.4':
      Issue bpo-24570: Right-click for context menus now work on Mac Aqual also.
      https://hg.python.org/cpython/rev/51b2b1a821b7

    10. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      topic-IDLEtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions