Subject: bug#63764: 30.0.50; pixel-scroll-precision-mode starts skipping pages after selecting region

From: Patrick Poitras <[email-masked]>
Date: Sat, 27 May 2023 22:16:31 -0700

The following steps reproduces the bug.

Start emacs with `emacs -Q`

M-x pixel-scroll-precision-mode

Scroll a large buffer, works great.

Click and drag to select a region in the buffer. Click somewhere else in
the buffer. to unselect it. Scrolling around will now randomly skip entire
pages after scrolling 4-5 lines. This makes the mode unusable.

Additional info:

This emacs version is built using the settings for the default Tumbleweed
install, but with emacs 30.0.50 and some different settings. (native comp
and treesit)

emacs-30.0.50.14776.d4ff1d74209-65.6.x86_64 from vendor obs://
build.opensuse.org/home:Thaodan

In GNU Emacs 30.0.50 (build 1, x86_64-suse-linux-gnu, GTK+ Version
3.24.38, cairo version 1.17.8)
System Description: openSUSE Tumbleweed

Configured using:
 'configure --disable-build-details --without-pop --with-mailutils
 --without-hesiod --with-gameuser=:games --with-kerberos
 --with-kerberos5 --with-file-notification=inotify --with-modules
 --enable-autodepend --prefix=/usr --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --localstatedir=/var
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --with-file-notification=yes --with-native-compilation=aot
 --enable-locallisppath=/usr/share/emacs/30.0.50/site-lisp:/usr/share/emacs/site-lisp
 --with-x --with-xim --with-sound --with-xpm --with-jpeg --with-tiff
 --with-gif --with-png --with-rsvg --with-dbus --with-xft --without-gpm
 --with-tree-sitter --with-pgtk --with-toolkit-scroll-bars
 --x-includes=/usr/include --x-libraries=/usr/lib64 --with-libotf
 --with-m17n-flt --with-cairo --with-xwidgets --build=x86_64-suse-linux
 --with-dumping=pdumper 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE
 -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables
 -fasynchronous-unwind-tables -fstack-clash-protection
 -Werror=return-type -flto=auto -g -D_GNU_SOURCE
 -DGDK_DISABLE_DEPRECATION_WARNINGS -DGLIB_DISABLE_DEPRECATION_WARNINGS
 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label
 -fno-optimize-sibling-calls -DPDMP_BASE='\''"emacs-gtk"'\'''
 LDFLAGS=-Wl,-O2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LC_NUMERIC: POSIX
  value of $LANG: en_US.utf8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  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
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: 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 time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-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 theme-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 dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 77561 8914)
 (symbols 48 7157 0)
 (strings 32 19290 1790)
 (string-bytes 1 576469)
 (vectors 16 14516)
 (vector-slots 8 263723 10059)
 (floats 8 28 52)
 (intervals 56 377 0)
 (buffers 984 12))