Skip to content

avoid select while window becoming active (getting focus) #717

Closed

Description

@lededev

When I switch from other application to mintty by mouse click, or switch between two mintty windows, it is often get two effects:

  1. mintty window change from inactive to active.
  2. some characters were selected by that mouse click with slightly mouse moving(with a high DPI mouse).

If I set the option 'Copy on select', that means my clipboard data was overwritten by this action.
I have to go back to copy source window and copy again because of that. Or I have to switch between mintty windows very carefully, and that will reduce my efficiency of operation.
Can you let the mouse select not so sensitive while a mintty window from inactive JUST become active? Or ignore select action at all while window just become active.

Activity

  1. lededev commented on Dec 10, 2017

    @lededev
    Author

    Hi, this commit of enhancement make mouse left button click to active mintty window avoid select action pretty good!
    But mouse click using right or middle button actions also changed, only active window no pop up menu or paste, I think that is a side effect should not happen. Only handle left click to prevent select is ok, let right or middle click act as before will be better for users habit.

  2. mintty commented on Dec 10, 2017

    @mintty
    Owner

    Thanks, and also a click on the window border should not be ignored, esp. to move the window.
    Fixed.

  3. mintty commented on Dec 16, 2017

    @mintty
    Owner

    Released 2.8.2.

  4. mintty commented on Feb 4, 2018

    @mintty
    Owner

    I've revised the handling to allow other mouse functions (see issue referencing above).
    You may like to check the update.

  5. mintty commented on Feb 6, 2018

    @mintty
    Owner

    Released 2.8.4.

  6. mintty commented on Apr 10, 2018

    @mintty
    Owner

    Another revision:
    Suppressing selection completely was not satisfying. Introduced a threshhold of spanned mouse drag-and-drop distance (delta-x + delta-y > 1) above which even a drag-and-drop started with an initial focus click would cause text to be selected.
    You may wish to check out this change.

  7. mintty commented on Apr 12, 2018

    @mintty
    Owner

    Released 2.8.5: if you drag the mouse after focus-click, above a small distance threshhold, selection is reenabled.

  8. lededev commented on Apr 29, 2018

    @lededev
    Author

    I think it will be better if add a time condition.
    We can suppose a select action can not accomplished in 0.35 second.
    Two conditions distance and time, to filter the select action while window get focus.

  9. 2 remaining items

  10. StarlitGhost commented on May 16, 2018

    @StarlitGhost

    I would really like a way to disable this, as it stops clicks passing through to tmux and weechat when the window is unfocused, requiring me to click twice.

    I have mouse support enabled in both, and I use it to switch windows/panes in tmux and channels in weechat.
    Having the mouse support enabled also means that accidental click+drag selection cannot happen, so I'm not getting any benefit out of this.

  11. mintty commented on May 17, 2018

    @mintty
    Owner

    I'll check this myself too, but please describe in what way tmux avoids accidental mouse-triggered actions.

  12. mintty commented on May 17, 2018

    @mintty
    Owner

    I intend to limit the suppression of focus-selection to non-application-mouse mode, i.e. while application mouse mode is enabled (and not overridden?), mouse clicks would be addressed to the application as usual, even if they are focus clicks. The idea behind this is that an application can detect all cases itself if it runs with application mouse mode.
    Alternatively, focus-selection suppression could only be disabled if focus event reporting (and application mouse mode?) is enabled. The idea behind this variant is that it clearly indicates the application is aware of focus clicks and will handle them if desired.

    Would that help with the tmux case? Have you configured tmux to enable mouse modes?
    Comments appreciated.

  13. mintty commented on May 17, 2018

    @mintty
    Owner

    I've implemented option 2 above and tentatively uploaded that. Please check it out.

  14. StarlitGhost commented on May 23, 2018

    @StarlitGhost

    tmux is configured to enable mouse modes, yes. Clicking and dragging in that mode uses tmux's own selection logic and does not copy into the system clipboard.

    In weechat with mouse enabled, no selection occurs at all.

    I'll see about building and trying this out this weekend.

  15. mintty commented on Jul 1, 2018

    @mintty
    Owner

    Released 2.9.0.

  16. changed the title [-]avoid select while window active[/-] [+]avoid select while window becoming active (getting focus)[/+] on Sep 9, 2018
  17. mintty commented on Sep 20, 2018

    @mintty
    Owner

    Released 2.9.1.

  18. YAMLcase commented on Jul 7, 2021

    @YAMLcase

    for tmux, setting set -g focus-events on will enable the pane selection on focus feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions