]> granicus.if.org Git - vim/commitdiff
patch 7.4.938 v7.4.938
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 14:38:44 +0000 (15:38 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 14:38:44 +0000 (15:38 +0100)
Problem:    X11 and GTK have moure mouse buttons than Vim supports.
Solution:   Recognize more mouse buttons. (Benoit Pierre, closes #498)

src/gui_gtk_x11.c
src/gui_x11.c
src/version.c

index d19e61a8ed2cfe061d31335e6189aa8d97576a7c..9b3bf61c765d1a6cb5191b7179b1235fe1a6359d 100644 (file)
@@ -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
index 276930728f51228b3e0484928e140718b11e036b..18a580590fcf23f82127822607cc08cef828b113 100644 (file)
@@ -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 */
            }
index 82e5f350d1627ce4699f5127c26625358a6dd4fe..c89c2633f3c5a88b10269ab1c9a8d596980c5cda 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    938,
 /**/
     937,
 /**/