changeset 7260:8ba562cb3e07 v7.4.938

commit https://github.com/vim/vim/commit/88e484bf1b0afb5f2dec44f19335729578ace66a Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 24 15:38:44 2015 +0100 patch 7.4.938 Problem: X11 and GTK have moure mouse buttons than Vim supports. Solution: Recognize more mouse buttons. (Benoit Pierre, closes https://github.com/vim/vim/issues/498)
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Nov 2015 15:45:04 +0100
parents 9369e07b5ca7
children e558d54fcb5c
files src/gui_gtk_x11.c src/gui_x11.c src/version.c
diffstat 3 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -1680,17 +1680,15 @@ button_press_event(GtkWidget *widget,
 
     switch (event->button)
     {
-    case 1:
-	button = MOUSE_LEFT;
-	break;
-    case 2:
-	button = MOUSE_MIDDLE;
-	break;
-    case 3:
-	button = MOUSE_RIGHT;
-	break;
-    default:
-	return FALSE;		/* Unknown button */
+	/* Keep in sync with gui_x11.c.
+	 * Buttons 4-7 are handled in scroll_event() */
+	case 1: button = MOUSE_LEFT; break;
+	case 2: button = MOUSE_MIDDLE; break;
+	case 3: button = MOUSE_RIGHT; break;
+	case 8: button = MOUSE_X1; break;
+	case 9: button = MOUSE_X2; break;
+	default:
+	    return FALSE;		/* Unknown button */
     }
 
 #ifdef FEAT_XIM
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -1127,11 +1127,16 @@ gui_x11_mouse_cb(w, dud, event, dum)
 			gui_x11_timer_cb, &timed_out);
 	    switch (event->xbutton.button)
 	    {
+		/* keep in sync with gui_gtk_x11.c */
 		case Button1:	button = MOUSE_LEFT;	break;
 		case Button2:	button = MOUSE_MIDDLE;	break;
 		case Button3:	button = MOUSE_RIGHT;	break;
 		case Button4:	button = MOUSE_4;	break;
 		case Button5:	button = MOUSE_5;	break;
+		case 6:		button = MOUSE_7;	break;
+		case 7:		button = MOUSE_6;	break;
+		case 8:		button = MOUSE_X1;	break;
+		case 9:		button = MOUSE_X2;	break;
 		default:
 		    return;	/* Unknown button */
 	    }
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    938,
+/**/
     937,
 /**/
     936,