Skip to content

Commit de7762a

Browse files
committed
patch 7.4.2238
Problem: With SGR mouse reporting (suckless terminal) the mouse release and scroll up/down is confused. Solution: Don't see a release as a scroll up/down. (Ralph Eastwood)
1 parent 9b7f8ce commit de7762a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/term.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4939,15 +4939,15 @@ check_termcode(
49394939
button = getdigits(&p);
49404940
mouse_code = 0;
49414941

4942-
switch( button )
4942+
switch (button)
49434943
{
49444944
case 4: mouse_code = MOUSE_LEFT; break;
49454945
case 1: mouse_code = MOUSE_RIGHT; break;
49464946
case 2: mouse_code = MOUSE_MIDDLE; break;
49474947
default: return -1;
49484948
}
49494949

4950-
switch( action )
4950+
switch (action)
49514951
{
49524952
case 31: /* Initial press */
49534953
if (*p++ != ';')
@@ -5096,9 +5096,11 @@ check_termcode(
50965096
else if (orig_num_clicks == 4)
50975097
modifiers |= MOD_MASK_4CLICK;
50985098

5099-
/* Work out our pseudo mouse event */
5099+
/* Work out our pseudo mouse event. Note that MOUSE_RELEASE gets
5100+
* added, then it's not mouse up/down. */
51005101
key_name[0] = (int)KS_EXTRA;
5101-
if (wheel_code != 0)
5102+
if (wheel_code != 0
5103+
&& (wheel_code & MOUSE_RELEASE) != MOUSE_RELEASE)
51025104
{
51035105
if (wheel_code & MOUSE_CTRL)
51045106
modifiers |= MOD_MASK_CTRL;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2238,
766768
/**/
767769
2237,
768770
/**/

0 commit comments

Comments
 (0)