Subject: bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down

From: Mickey Petersen <[email-masked]>
Date: Wed, 2 Nov 2022 16:20:40 +0000

Note: I'm using the tree-sitter branch, but the issue also appears in 
the master
branch. Emacs 28.x works fine.

When I scroll down with my mouse wheel -- typically after an existing 
window has changed
buffers, such as after selecting (via keyboard or mouse) an Info manual 
node --
the scroll action sometimes (but not always) jerks upwards several
lines. I can then keep scrolling and it'll start scrolling down
again. This may sometimes happen after scrolling for a little while, and
sometimes not at all.

It's hard to reproduce; but the issue affects a baseline Emacs build (-Q or
-q) and only sometimes.

I had a look in the bug tracker for `scroll' and found nothing. I also
checked `M-x customize-changed' to look for likely culprits. I found
nothing that may cause this behaviour, beyond pixel scrolling, which 
seems like a smoking gun to me,
but it's off by default in emacs -Q.

1. Is it possible there are changes the scrolling code that is active even
when that mode is not?

2. Could there be some sort of variable that determines scroll direction 
that, somehow, gets confused?

Thanks.

Mickey.

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
  3.24.20, cairo version 1.16.0) of 2022-10-28 built on mickey-work
Repository revision: 629f222ba2abf5a149c381e27c89e88963f7466d
Repository branch: feature/tree-sitter
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.3 LTS

Configured using:
  'configure --with-mailutils --with-imagemagick --with-json
  --with-xwidgets --with-native-compilation --without-compress-install
  --with-tree-sitter'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE-SITTER X11 XDBE XIM
XINPUT2 XPM XWIDGETS GTK3 ZLIB

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

Major mode: Info

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   isearch-fold-quotes-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   buffer-read-only: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util info edmacro
kmacro tutorial time-date cl-loaddefs comp comp-cstr warnings icons
subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile
cconv cl-lib rmc iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode 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 lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 106055 14079)
  (symbols 48 7684 0)
  (strings 32 24382 2092)
  (string-bytes 1 692381)
  (vectors 16 16014)
  (vector-slots 8 280598 15332)
  (floats 8 92 262)
  (intervals 56 4484 0)
  (buffers 1008 13))