Skip to content

Commit 88e484b

Browse files
committed
patch 7.4.938
Problem: X11 and GTK have moure mouse buttons than Vim supports. Solution: Recognize more mouse buttons. (Benoit Pierre, closes #498)
1 parent 5ad075c commit 88e484b

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

src/gui_gtk_x11.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,17 +1680,15 @@ button_press_event(GtkWidget *widget,
16801680

16811681
switch (event->button)
16821682
{
1683-
case 1:
1684-
button = MOUSE_LEFT;
1685-
break;
1686-
case 2:
1687-
button = MOUSE_MIDDLE;
1688-
break;
1689-
case 3:
1690-
button = MOUSE_RIGHT;
1691-
break;
1692-
default:
1693-
return FALSE; /* Unknown button */
1683+
/* Keep in sync with gui_x11.c.
1684+
* Buttons 4-7 are handled in scroll_event() */
1685+
case 1: button = MOUSE_LEFT; break;
1686+
case 2: button = MOUSE_MIDDLE; break;
1687+
case 3: button = MOUSE_RIGHT; break;
1688+
case 8: button = MOUSE_X1; break;
1689+
case 9: button = MOUSE_X2; break;
1690+
default:
1691+
return FALSE; /* Unknown button */
16941692
}
16951693

16961694
#ifdef FEAT_XIM

src/gui_x11.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,11 +1127,16 @@ gui_x11_mouse_cb(w, dud, event, dum)
11271127
gui_x11_timer_cb, &timed_out);
11281128
switch (event->xbutton.button)
11291129
{
1130+
/* keep in sync with gui_gtk_x11.c */
11301131
case Button1: button = MOUSE_LEFT; break;
11311132
case Button2: button = MOUSE_MIDDLE; break;
11321133
case Button3: button = MOUSE_RIGHT; break;
11331134
case Button4: button = MOUSE_4; break;
11341135
case Button5: button = MOUSE_5; break;
1136+
case 6: button = MOUSE_7; break;
1137+
case 7: button = MOUSE_6; break;
1138+
case 8: button = MOUSE_X1; break;
1139+
case 9: button = MOUSE_X2; break;
11351140
default:
11361141
return; /* Unknown button */
11371142
}

src/version.c

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

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
938,
744746
/**/
745747
937,
746748
/**/

0 commit comments

Comments
 (0)