To: vim_dev@googlegroups.com Subject: Patch 7.4.938 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.938 Problem: X11 and GTK have moure mouse buttons than Vim supports. Solution: Recognize more mouse buttons. (Benoit Pierre, closes #498) Files: src/gui_gtk_x11.c, src/gui_x11.c *** ../vim-7.4.937/src/gui_gtk_x11.c 2015-09-15 14:12:01.382632522 +0200 --- src/gui_gtk_x11.c 2015-11-24 15:37:55.319977459 +0100 *************** *** 1680,1696 **** 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 */ } #ifdef FEAT_XIM --- 1680,1694 ---- switch (event->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 *** ../vim-7.4.937/src/gui_x11.c 2015-09-15 14:12:01.382632522 +0200 --- src/gui_x11.c 2015-11-24 15:36:47.524723361 +0100 *************** *** 1127,1137 **** --- 1127,1142 ---- 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 */ } *** ../vim-7.4.937/src/version.c 2015-11-24 15:18:28.032829239 +0100 --- src/version.c 2015-11-24 15:28:38.946100648 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 938, /**/ -- In a world without fences, who needs Gates and Windows? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///