Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
roseman mannequin opened this issue Aug 6, 2015 · 9 comments
Closed

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

roseman mannequin opened this issue Aug 6, 2015 · 9 comments
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@roseman
Copy link
Mannequin

roseman mannequin commented Aug 6, 2015

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']

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 6, 2015

    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.

    @roseman roseman mannequin added type-bug An unexpected behavior, bug, or error topic-IDLE labels Aug 6, 2015
    @terryjreedy
    Copy link
    Member

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

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 7, 2015

    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.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 7, 2015

    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.

    @serhiy-storchaka
    Copy link
    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.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 14, 2015

    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. :-)

    @serhiy-storchaka
    Copy link
    Member

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

    Added comments on Rietveld.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 18, 2015

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

    @terryjreedy
    Copy link
    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants