Subject: bug#41722: 26.3; mouse-2 does not work well on 7 button mouse

From: Jason <[email-masked]>
Date: Fri, 05 Jun 2020 11:35:56 -0300

My mouse has the mouse-wheel-right/left-event capability, however due to
the HW design if you try to generate mouse-2 (eg middle click) it nearly
always is preceded by a mouse-6 or mouse-7 event. xev confirms this.

At some point mwheel.el gained support for the
mouse-wheel-right/left-event, and traps it into
mwheel-scroll. mwheel-scroll causes *any* wheel event to disable mouse-2
on a timer (see mwheel-inhibit-click-event-timer).

Thus with my mouse middle click doesn't work in emacs any more. This is
a new regression at some point since emacs 25.2

Since the mwheel left/right scroll is inhibited by default (see
mouse-wheel-tilt-scroll) it should not trigger the inhibit click event
timer unless that function is turned on.

This mouse is a logitech M-U0007

A simple work around is to unbind mouse-6/7 but it was very tricky to
figure all this out.

In GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14)
 of 2020-03-26, modified by Debian built on lcy01-amd64-020
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description:	Ubuntu 20.04 LTS

Recent messages:
Auto-saving...done
Making completion list...
Type C-x 1 to delete the help window.
Auto-saving...
Starting new Ispell process aspell with default dictionary...
Checking spelling of SUPRESSED...
Auto-saving...done
Saving file /home/njgg/dotfiles/emacs/jgg-mcutpaste.el...
Wrote /home/njgg/dotfiles/emacs/jgg-mcutpaste.el
<f2> is undefined

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --build
 x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
 --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-mEZBk7/emacs-26.3+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  global-auto-revert-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash hides /usr/share/emacs/site-lisp/elpa-src/dash-2.17.0/dash
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-autoloads hides /usr/share/emacs/site-lisp/elpa-src/dash-2.17.0/dash-autoloads
/usr/share/emacs/site-lisp/elpa/dash-2.17.0/dash-pkg hides /usr/share/emacs/site-lisp/elpa-src/dash-2.17.0/dash-pkg
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/buck hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/buck
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/gogs hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/gogs
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/ghub-pkg hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/ghub-pkg
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/glab hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/glab
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/ghub-autoloads hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/ghub-autoloads
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/ghub-graphql hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/ghub-graphql
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/ghub hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/ghub
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/gsexp hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/gsexp
/usr/share/emacs/site-lisp/elpa/ghub-3.3.0/gtea hides /usr/share/emacs/site-lisp/elpa-src/ghub-3.3.0/gtea
/usr/share/emacs/site-lisp/elpa/git-commit-2.90.1/git-commit hides /usr/share/emacs/site-lisp/elpa-src/git-commit-2.90.1/git-commit
/usr/share/emacs/site-lisp/elpa/git-commit-2.90.1/git-commit-pkg hides /usr/share/emacs/site-lisp/elpa-src/git-commit-2.90.1/git-commit-pkg
/usr/share/emacs/site-lisp/elpa/git-commit-2.90.1/git-commit-autoloads hides /usr/share/emacs/site-lisp/elpa-src/git-commit-2.90.1/git-commit-autoloads
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist-pkg hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist-pkg
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist-autoloads hides /usr/share/emacs/site-lisp/elpa-src/let-alist-1.0.6/let-alist-autoloads
/usr/share/emacs/site-lisp/elpa/magit-popup-2.13.2/magit-popup-pkg hides /usr/share/emacs/site-lisp/elpa-src/magit-popup-2.13.2/magit-popup-pkg
/usr/share/emacs/site-lisp/elpa/magit-popup-2.13.2/magit-popup-autoloads hides /usr/share/emacs/site-lisp/elpa-src/magit-popup-2.13.2/magit-popup-autoloads
/usr/share/emacs/site-lisp/elpa/magit-popup-2.13.2/magit-popup hides /usr/share/emacs/site-lisp/elpa-src/magit-popup-2.13.2/magit-popup
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.3snapshot210/markdown-mode hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.3snapshot210/markdown-mode
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.3snapshot210/markdown-mode-autoloads hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.3snapshot210/markdown-mode-autoloads
/usr/share/emacs/site-lisp/elpa/markdown-mode-2.3snapshot210/markdown-mode-pkg hides /usr/share/emacs/site-lisp/elpa-src/markdown-mode-2.3snapshot210/markdown-mode-pkg
/usr/share/emacs/site-lisp/elpa/treepy-0.1.1/treepy hides /usr/share/emacs/site-lisp/elpa-src/treepy-0.1.1/treepy
/usr/share/emacs/site-lisp/elpa/treepy-0.1.1/treepy-autoloads hides /usr/share/emacs/site-lisp/elpa-src/treepy-0.1.1/treepy-autoloads
/usr/share/emacs/site-lisp/elpa/treepy-0.1.1/treepy-pkg hides /usr/share/emacs/site-lisp/elpa-src/treepy-0.1.1/treepy-pkg
/usr/share/emacs/site-lisp/elpa/with-editor-2.6.0/with-editor-pkg hides /usr/share/emacs/site-lisp/elpa-src/with-editor-2.6.0/with-editor-pkg
/usr/share/emacs/site-lisp/elpa/with-editor-2.6.0/with-editor-autoloads hides /usr/share/emacs/site-lisp/elpa-src/with-editor-2.6.0/with-editor-autoloads
/usr/share/emacs/site-lisp/elpa/with-editor-2.6.0/with-editor hides /usr/share/emacs/site-lisp/elpa-src/with-editor-2.6.0/with-editor
/usr/share/emacs/site-lisp/elpa/yaml-mode-0.0.14/yaml-mode-pkg hides /usr/share/emacs/site-lisp/elpa-src/yaml-mode-0.0.14/yaml-mode-pkg
/usr/share/emacs/site-lisp/elpa/yaml-mode-0.0.14/yaml-mode-autoloads hides /usr/share/emacs/site-lisp/elpa-src/yaml-mode-0.0.14/yaml-mode-autoloads
/usr/share/emacs/site-lisp/elpa/yaml-mode-0.0.14/yaml-mode hides /usr/share/emacs/site-lisp/elpa-src/yaml-mode-0.0.14/yaml-mode
~/dotfiles/emacs/mwheel hides /usr/share/emacs/26.3/lisp/mwheel
~/dotfiles/emacs/verilog-mode hides /usr/share/emacs/26.3/lisp/progmodes/verilog-mode
/usr/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /usr/share/emacs/26.3/lisp/emacs-lisp/let-alist

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils ispell cl-print mouse-copy mouse-drag thingatpt grep
jgg-compile reposition compile comint ansi-color ring cl-extra eieio-opt
speedbar sb-image ezimage dframe find-func help-fns radix-tree help-mode
jgg-vc-git vc-git diff-mode easy-mmode elec-pair buff-menu+ derived cl
advice autorevert filenotify time finder-inf package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 149412 10533)
 (symbols 48 24551 1)
 (miscs 40 99 284)
 (strings 32 43136 1845)
 (string-bytes 1 1150707)
 (vectors 16 19637)
 (vector-slots 8 572978 6496)
 (floats 8 70 281)
 (intervals 56 1682 213)
 (buffers 992 16))