You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
avoid select while window becoming active (getting focus) #717
When I switch from other application to mintty by mouse click, or switch between two mintty windows, it is often get two effects:
mintty window change from inactive to active.
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.
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.
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.
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.
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.
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.
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.
Activity
prevent accidental selection on activation (#717)
lededev commentedon Dec 10, 2017
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.
limit mouse-activation tweak to relevant case left-click in client ar…
mintty commentedon Dec 10, 2017
Thanks, and also a click on the window border should not be ignored, esp. to move the window.
Fixed.
mintty commentedon Dec 16, 2017
Released 2.8.2.
more selective suppression of mouse action on focus-click (wsltty#88, #…
mintty commentedon Feb 4, 2018
I've revised the handling to allow other mouse functions (see issue referencing above).
You may like to check the update.
mintty commentedon Feb 6, 2018
Released 2.8.4.
reenable drag-and-drop text selection on focussing at a threshhold (~#…
mintty commentedon Apr 10, 2018
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.
mintty commentedon Apr 12, 2018
Released 2.8.5: if you drag the mouse after focus-click, above a small distance threshhold, selection is reenabled.
lededev commentedon Apr 29, 2018
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.
threshold to allow selection on focus click combines geom and time di…
2 remaining items
StarlitGhost commentedon May 16, 2018
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.
mintty commentedon May 17, 2018
I'll check this myself too, but please describe in what way tmux avoids accidental mouse-triggered actions.
mintty commentedon May 17, 2018
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.
only suppress focus-click selection if focus reporting disabled or mo…
mintty commentedon May 17, 2018
I've implemented option 2 above and tentatively uploaded that. Please check it out.
StarlitGhost commentedon May 23, 2018
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.
mintty commentedon Jul 1, 2018
Released 2.9.0.
[-]avoid select while window active[/-][+]avoid select while window becoming active (getting focus)[/+]mintty commentedon Sep 20, 2018
Released 2.9.1.
revert focus-click suppression (issue mintty#717)
revert focus-click suppression (issue mintty#717)
YAMLcase commentedon Jul 7, 2021
for tmux, setting
set -g focus-events onwill enable the pane selection on focus feature.wininput: don't strand selection mode when a focus-click release is lost
wininput: don't strand selection mode when a focus-click release is lost