GNU bug report logs - #52685
29.0.50; Horizontal scrolling doesn't work when compiled with pgtk

Previous Next

Package: emacs;

Reported by: Andrey Listopadov <andreyorst <at> gmail.com>

Date: Mon, 20 Dec 2021 20:44:01 UTC

Severity: normal

Found in version 29.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52685 in the body.
You can then email your comments to 52685 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Mon, 20 Dec 2021 20:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrey Listopadov <andreyorst <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Dec 2021 20:44:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Horizontal scrolling doesn't work when compiled with pgtk
Date: Mon, 20 Dec 2021 23:42:47 +0300
After PGTK was merged I've compiled Emacs with the required switch.  The
first thing I've noticed was that --with-xinput2 has no effect when
--with-pgtk switch is supplied, so I've removed it.  I'm not sure if
this is intentional or not.  The main issue now is that horizontal
scrolling with a touchpad no longer works for me. All horizontal events
are registered as mwheel-down events.

In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.30, cairo version 1.17.4)
 of 2021-12-20 built on toolbox
Repository revision: eaa44ca40e8da9ba86e6e03b76b41fd6843661d6
Repository branch: master
Windowing system distributor 'System Description: Fedora Linux 35
(Workstation Edition)

Configured using:
 'configure --with-native-compilation --with-pgtk
 --prefix=/home/alist/.local'

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

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

Major mode: Lisp Interaction

Minor modes in effect:
  isayt-mode: t
  smartparens-strict-mode: t
  smartparens-mode: t
  hl-todo-mode: t
  global-auto-revert-mode: t
  gcmh-mode: t
  which-key-mode: t
  recentf-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  editorconfig-mode: t
  csv-field-index-mode: t
  shell-dirtrack-mode: t
  pixel-scroll-precision-mode: t
  corfu-global-mode: t
  corfu-mode: t
  marginalia-mode: t
  vertico-mode: t
  minions-mode: t
  delete-selection-mode: t
  savehist-mode: t
  common-lisp-modes-mode: t
  override-global-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Load-path shadows:
/home/alist/.config/emacs/straight/build-29.0.50/transient/transient
hides /home/alist/.local/share/emacs/29.0.50/lisp/transient
/home/alist/.config/emacs/straight/build-29.0.50/xref/xref hides
/home/alist/.local/share/emacs/29.0.50/lisp/progmodes/xref
/home/alist/.config/emacs/straight/build-29.0.50/project/project hides
/home/alist/.local/share/emacs/29.0.50/lisp/progmodes/project
/home/alist/.config/emacs/straight/build-29.0.50/map/map hides
/home/alist/.local/share/emacs/29.0.50/lisp/emacs-lisp/map
/home/alist/.config/emacs/straight/build-29.0.50/let-alist/let-alist
hides /home/alist/.local/share/emacs/29.0.50/lisp/emacs-lisp/let-alist
/home/alist/.local/share/emacs/29.0.50/lisp/emacs-lisp/eieio-compat
hides /home/alist/.local/share/emacs/29.0.50/lisp/obsolete/eieio-compat

Features:
(shadow mail-extr emacsbug message yank-media rmc rfc822 mml mml-sec epa
epg rfc6068 epg-config mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader sendmail mule-util isayt disp-table flyspell ispell
smartparens-config smartparens-text smartparens-html smartparens-elixir
smartparens-clojure smartparens dumb-jump popup s hl-todo autorevert
filenotify init aoc ht aoc-autoloads ht-autoloads jdecomp-autoloads
esh-mode esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util isayt-autoloads gcmh gcmh-autoloads which-key
which-key-autoloads dumb-jump-autoloads popup-autoloads recentf
tree-widget separedit-autoloads edit-indirect-autoloads server
project-autoloads xref-autoloads magit-todos-autoloads pcre2el-autoloads
hl-todo-autoloads f-autoloads s-autoloads async-autoloads
magit-autoloads magit-section-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads undo-tree diff
undo-tree-autoloads smartparens-autoloads flycheck-package package-lint
finder package url-handlers flycheck-package-autoloads
package-lint-autoloads let-alist pcase flymake-proc flymake editorconfig
editorconfig-autoloads vterm-autoloads doc-view jka-compr image-mode
exif dired dired-loaddefs elixir-mode elixir-format elixir-smie
elixir-mode-autoloads erlang tempo erlang-autoloads csv-mode sort
csv-mode-autoloads json-mode-autoloads json-snatcher-autoloads css-mode
smie sgml-mode facemenu eww xdg url-queue shr pixel-fill kinsoku svg xml
dom browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source eieio
eieio-core eieio-loaddefs password-cache url-vars mailcap puny mm-url
gnus nnheader gnus-util time-date mail-utils color lua-mode-autoloads
yaml-mode yaml-mode-autoloads racket-mode-autoloads sly-autoloads
clj-refactor-autoloads hydra-autoloads lv-autoloads
inflections-autoloads multiple-cursors-autoloads paredit-autoloads
yasnippet-autoloads flycheck-clj-kondo flycheck json map find-func dash
flycheck-clj-kondo-autoloads flycheck-autoloads let-alist-autoloads
dash-autoloads cider-autoloads sesman vc vc-dispatcher sesman-autoloads
spinner-autoloads queue-autoloads pkg-info-autoloads epl-autoloads
finder-inf parseedn-autoloads map-autoloads parseclj-autoloads
inferior-clojure derived clojure-mode lisp-mnt mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr align thingatpt imenu
inf-lisp shell pcomplete clojure-mode-autoloads fennel-mode-autoloads
geiser-guile info-look geiser geiser-repl compile text-property-search
geiser-image geiser-company geiser-doc geiser-menu geiser-edit etags
fileloop generator xref project geiser-completion geiser-autodoc advice
geiser-eval geiser-connection tq geiser-syntax scheme geiser-log comint
ansi-color geiser-popup view geiser-guile-autoloads geiser-impl help-fns
radix-tree geiser-custom geiser-base geiser-autoloads
markdown-mode-autoloads ox-hugo-autoloads pixel-scroll ring formfeed
cape cape-autoloads corfu corfu-autoloads consult-autoloads marginalia
marginalia-autoloads vertico vertico-autoloads minions minions-autoloads
display-line-numbers modus-vivendi-theme modus-themes
modus-themes-autoloads delsel savehist comp comp-cstr warnings rx novice
cus-edit pp cus-load wid-edit font defaults edmacro kmacro
common-lisp-modes-mode functions local-config use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core
use-package-autoloads bind-key-autoloads early-init straight-autoloads
info cl-seq cl-extra help-mode seq byte-opt straight subr-x cl-macs gv
cl-loaddefs cl-lib bytecomp byte-compile cconv iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/pgtk-win pgtk-win term/common-win 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 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
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 dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit pgtk lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 439300 347003)
 (symbols 48 49273 658)
 (strings 32 120328 161276)
 (string-bytes 1 4376451)
 (vectors 16 46029)
 (vector-slots 8 783458 512099)
 (floats 8 340 1112)
 (intervals 56 409 120)
 (buffers 992 12))


-- 
Andrey Listopadov




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 21 Dec 2021 01:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 21 Dec 2021 09:27:59 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> After PGTK was merged I've compiled Emacs with the required switch.  The
> first thing I've noticed was that --with-xinput2 has no effect when
> --with-pgtk switch is supplied, so I've removed it.  I'm not sure if
> this is intentional or not.  The main issue now is that horizontal
> scrolling with a touchpad no longer works for me. All horizontal events
> are registered as mwheel-down events.

To answer your first question: since the PGTK build doesn't use X, the
--with-xinput2 option has no effect.

As for the second problem, I don't see the problem here, but I'm copying
in Yuuki as he might have some ideas.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 21 Dec 2021 07:24:01 GMT) Full text and rfc822 format available.

Message #11 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 21 Dec 2021 10:22:55 +0300
[Message part 1 (text/plain, inline)]
вт, 21 дек. 2021 г., 04:28 Po Lu <luangruo <at> yahoo.com>:

> Andrey Listopadov <andreyorst <at> gmail.com> writes:
>
> > After PGTK was merged I've compiled Emacs with the required switch.  The
> > first thing I've noticed was that --with-xinput2 has no effect when
> > --with-pgtk switch is supplied, so I've removed it.  I'm not sure if
> > this is intentional or not.  The main issue now is that horizontal
> > scrolling with a touchpad no longer works for me. All horizontal events
> > are registered as mwheel-down events.
>
> To answer your first question: since the PGTK build doesn't use X, the
> --with-xinput2 option has no effect.
>
> As for the second problem, I don't see the problem here, but I'm copying
> in Yuuki as he might have some ideas.
>
> Thanks.
>

Makes sense, thanks.

>
By "I don't see the problem here" do you mean horizontal scrolling works
for you on PGTK build?

I've tested this on my second laptop, which has different manufacturer, and
it doesn't work there either.  For the record, I'm using Fedora 34 and 35.


-- 
Andrey Listopadov

>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 21 Dec 2021 07:29:02 GMT) Full text and rfc822 format available.

Message #14 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 21 Dec 2021 15:27:45 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> By "I don't see the problem here" do you mean horizontal scrolling
> works for you on PGTK build?

Yes.

> I've tested this on my second laptop, which has different
> manufacturer, and it doesn't work there either.  For the record, I'm
> using Fedora 34 and 35.

Same here, I'm using Fedora 35.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 21 Dec 2021 13:29:02 GMT) Full text and rfc822 format available.

Message #17 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Yuuki Harano <masm+emacs <at> masm11.me>
To: andreyorst <at> gmail.com
Cc: luangruo <at> yahoo.com, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 21 Dec 2021 22:28:47 +0900 (JST)
> The main issue now is that horizontal
> scrolling with a touchpad no longer works for me. All horizontal events
> are registered as mwheel-down events.

Are all of left and right scroll events registered as mwheel-down?

Does the issue reproduce even if `emacs -Q`?

-- 
Yuuki Harano




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 21 Dec 2021 13:55:02 GMT) Full text and rfc822 format available.

Message #20 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Yuuki Harano <masm+emacs <at> masm11.me>
Cc: luangruo <at> yahoo.com, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 21 Dec 2021 16:54:13 +0300
[Message part 1 (text/plain, inline)]
вт, 21 дек. 2021 г., 16:28 Yuuki Harano <masm+emacs <at> masm11.me>:

>
> > The main issue now is that horizontal
> > scrolling with a touchpad no longer works for me. All horizontal events
> > are registered as mwheel-down events.
>
> Are all of left and right scroll events registered as mwheel-down?
>
> Does the issue reproduce even if `emacs -Q`?
>
> --
> Yuuki Harano



I've figured out that this was caused by me enabling
`pixel-scroll-precision-mode'. If the mode is enabled, all horizontal
events are treated as wheel-down in PGTK build. Additionally to that, it
seems that all events that are not exactly wheel-up are treated as down
events, e.g. C-<wheel-up> is also seen as C-<wheel-down> (in `emacs -Q'
with `pixel-scroll-precision-mode' enabled)

When `pixel-scroll-precision-mode' is disabled everything works fine.
When compiled without `--with-pgtk' but with `--with-xinput2'
`pixel-scroll-precision-mode' works as expected.


--
Andrey Listopadov
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 01:01:01 GMT) Full text and rfc822 format available.

Message #23 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 09:00:09 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> When `pixel-scroll-precision-mode' is disabled everything works fine.
> When compiled without `--with-pgtk' but with `--with-xinput2'
> `pixel-scroll-precision-mode' works as expected.

Thanks, I will look into this now.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 01:10:02 GMT) Full text and rfc822 format available.

Message #26 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 09:09:11 +0800
Po Lu <luangruo <at> yahoo.com> writes:

> Andrey Listopadov <andreyorst <at> gmail.com> writes:
>
>> When `pixel-scroll-precision-mode' is disabled everything works fine.
>> When compiled without `--with-pgtk' but with `--with-xinput2'
>> `pixel-scroll-precision-mode' works as expected.
>
> Thanks, I will look into this now.

Please try the following patch to see if it resolves your problem.
Thanks.

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index bd61c65edd..bea2650584 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -6133,78 +6133,64 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
     }
   else if (gdk_event_get_scroll_deltas (event, &delta_x, &delta_y))
     {
-      dpyinfo->scroll.acc_x += delta_x;
-      dpyinfo->scroll.acc_y += delta_y;
-      if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line
-	  || !mwheel_coalesce_scroll_events)
+      if (!mwheel_coalesce_scroll_events)
 	{
-	  int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
-	  inev.ie.kind = WHEEL_EVENT;
-	  inev.ie.modifiers |= down_modifier;
-	  inev.ie.arg = list3 (make_fixnum (nlines),
-			       make_float (-dpyinfo->scroll.acc_x * 100),
-			       make_float (-dpyinfo->scroll.acc_y * 100));
-	  if (!mwheel_coalesce_scroll_events)
-	    {
-	      dpyinfo->scroll.acc_y = 0;
-	      dpyinfo->scroll.acc_x = 0;
-	    }
-	  else
+	  inev.ie.kind = ((fabs (delta_x) > fabs (delta_y))
+			  ? HORIZ_WHEEL_EVENT
+			  : WHEEL_EVENT);
+	  inev.ie.modifiers = (inev.ie.kind == HORIZ_WHEEL_EVENT
+			       ? (delta_x >= 0 ? down_modifier : up_modifier)
+			       : (delta_y >= 0 ? down_modifier : up_modifier));
+	  inev.ie.arg = list3 (Qnil, make_float (delta_x),
+			       make_float (delta_y));
+	}
+      else
+	{
+	  dpyinfo->scroll.acc_x += delta_x;
+	  dpyinfo->scroll.acc_y += delta_y;
+	  if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line)
 	    {
+	      int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
+	      inev.ie.kind = WHEEL_EVENT;
+	      inev.ie.modifiers |= down_modifier;
+	      inev.ie.arg = list3 (make_fixnum (nlines),
+				   make_float (-dpyinfo->scroll.acc_x * 100),
+				   make_float (-dpyinfo->scroll.acc_y * 100));
 	      dpyinfo->scroll.acc_y -= dpyinfo->scroll.y_per_line * nlines;
 	    }
-	}
-      else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line
-	       || !mwheel_coalesce_scroll_events)
-	{
-	  int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
-	  inev.ie.kind = WHEEL_EVENT;
-	  inev.ie.modifiers |= up_modifier;
-	  inev.ie.arg = list3 (make_fixnum (nlines),
-			       make_float (-dpyinfo->scroll.acc_x * 100),
-			       make_float (-dpyinfo->scroll.acc_y * 100));
-
-	  if (!mwheel_coalesce_scroll_events)
+	  else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line)
 	    {
-	      dpyinfo->scroll.acc_y = 0;
-	      dpyinfo->scroll.acc_x = 0;
+	      int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
+	      inev.ie.kind = WHEEL_EVENT;
+	      inev.ie.modifiers |= up_modifier;
+	      inev.ie.arg = list3 (make_fixnum (nlines),
+				   make_float (-dpyinfo->scroll.acc_x * 100),
+				   make_float (-dpyinfo->scroll.acc_y * 100));
+
+	      dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
 	    }
-	  else
-	    dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
-	}
-      else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
-	       || !mwheel_coalesce_scroll_events)
-	{
-	  int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
-	  inev.ie.kind = HORIZ_WHEEL_EVENT;
-	  inev.ie.modifiers |= up_modifier;
-	  inev.ie.arg = list3 (make_fixnum (nchars),
-			       make_float (-dpyinfo->scroll.acc_x * 100),
-			       make_float (-dpyinfo->scroll.acc_y * 100));
-
-	  if (mwheel_coalesce_scroll_events)
-	    dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
-	  else
+	  else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
+		   || !mwheel_coalesce_scroll_events)
 	    {
-	      dpyinfo->scroll.acc_x = 0;
-	      dpyinfo->scroll.acc_y = 0;
+	      int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
+	      inev.ie.kind = HORIZ_WHEEL_EVENT;
+	      inev.ie.modifiers |= up_modifier;
+	      inev.ie.arg = list3 (make_fixnum (nchars),
+				   make_float (-dpyinfo->scroll.acc_x * 100),
+				   make_float (-dpyinfo->scroll.acc_y * 100));
+
+	      dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
 	    }
-	}
-      else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
-	{
-	  int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
-	  inev.ie.kind = HORIZ_WHEEL_EVENT;
-	  inev.ie.modifiers |= down_modifier;
-	  inev.ie.arg = list3 (make_fixnum (nchars),
-			       make_float (-dpyinfo->scroll.acc_x * 100),
-			       make_float (-dpyinfo->scroll.acc_y * 100));
-
-	  if (mwheel_coalesce_scroll_events)
-	    dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
-	  else
+	  else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
 	    {
-	      dpyinfo->scroll.acc_x = 0;
-	      dpyinfo->scroll.acc_y = 0;
+	      int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
+	      inev.ie.kind = HORIZ_WHEEL_EVENT;
+	      inev.ie.modifiers |= down_modifier;
+	      inev.ie.arg = list3 (make_fixnum (nchars),
+				   make_float (-dpyinfo->scroll.acc_x * 100),
+				   make_float (-dpyinfo->scroll.acc_y * 100));
+
+	      dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
 	    }
 	}
     }




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 05:57:01 GMT) Full text and rfc822 format available.

Message #29 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 08:55:44 +0300
On Wed, Dec 22, 2021 at 4:09 AM Po Lu <luangruo <at> yahoo.com> wrote:
>
> Po Lu <luangruo <at> yahoo.com> writes:
>
> > Andrey Listopadov <andreyorst <at> gmail.com> writes:
> >
> >> When `pixel-scroll-precision-mode' is disabled everything works fine.
> >> When compiled without `--with-pgtk' but with `--with-xinput2'
> >> `pixel-scroll-precision-mode' works as expected.
> >
> > Thanks, I will look into this now.
>
> Please try the following patch to see if it resolves your problem.
> Thanks.
>
> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
> index bd61c65edd..bea2650584 100644
> --- a/src/pgtkterm.c
> +++ b/src/pgtkterm.c
> @@ -6133,78 +6133,64 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
>      }
>    else if (gdk_event_get_scroll_deltas (event, &delta_x, &delta_y))
>      {
> -      dpyinfo->scroll.acc_x += delta_x;
> -      dpyinfo->scroll.acc_y += delta_y;
> -      if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line
> -         || !mwheel_coalesce_scroll_events)
> +      if (!mwheel_coalesce_scroll_events)
>         {
> -         int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> -         inev.ie.kind = WHEEL_EVENT;
> -         inev.ie.modifiers |= down_modifier;
> -         inev.ie.arg = list3 (make_fixnum (nlines),
> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> -         if (!mwheel_coalesce_scroll_events)
> -           {
> -             dpyinfo->scroll.acc_y = 0;
> -             dpyinfo->scroll.acc_x = 0;
> -           }
> -         else
> +         inev.ie.kind = ((fabs (delta_x) > fabs (delta_y))
> +                         ? HORIZ_WHEEL_EVENT
> +                         : WHEEL_EVENT);
> +         inev.ie.modifiers = (inev.ie.kind == HORIZ_WHEEL_EVENT
> +                              ? (delta_x >= 0 ? down_modifier : up_modifier)
> +                              : (delta_y >= 0 ? down_modifier : up_modifier));
> +         inev.ie.arg = list3 (Qnil, make_float (delta_x),
> +                              make_float (delta_y));
> +       }
> +      else
> +       {
> +         dpyinfo->scroll.acc_x += delta_x;
> +         dpyinfo->scroll.acc_y += delta_y;
> +         if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line)
>             {
> +             int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> +             inev.ie.kind = WHEEL_EVENT;
> +             inev.ie.modifiers |= down_modifier;
> +             inev.ie.arg = list3 (make_fixnum (nlines),
> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
>               dpyinfo->scroll.acc_y -= dpyinfo->scroll.y_per_line * nlines;
>             }
> -       }
> -      else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line
> -              || !mwheel_coalesce_scroll_events)
> -       {
> -         int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> -         inev.ie.kind = WHEEL_EVENT;
> -         inev.ie.modifiers |= up_modifier;
> -         inev.ie.arg = list3 (make_fixnum (nlines),
> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> -
> -         if (!mwheel_coalesce_scroll_events)
> +         else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line)
>             {
> -             dpyinfo->scroll.acc_y = 0;
> -             dpyinfo->scroll.acc_x = 0;
> +             int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> +             inev.ie.kind = WHEEL_EVENT;
> +             inev.ie.modifiers |= up_modifier;
> +             inev.ie.arg = list3 (make_fixnum (nlines),
> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> +
> +             dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
>             }
> -         else
> -           dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
> -       }
> -      else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
> -              || !mwheel_coalesce_scroll_events)
> -       {
> -         int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
> -         inev.ie.modifiers |= up_modifier;
> -         inev.ie.arg = list3 (make_fixnum (nchars),
> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> -
> -         if (mwheel_coalesce_scroll_events)
> -           dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
> -         else
> +         else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
> +                  || !mwheel_coalesce_scroll_events)
>             {
> -             dpyinfo->scroll.acc_x = 0;
> -             dpyinfo->scroll.acc_y = 0;
> +             int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
> +             inev.ie.modifiers |= up_modifier;
> +             inev.ie.arg = list3 (make_fixnum (nchars),
> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> +
> +             dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
>             }
> -       }
> -      else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
> -       {
> -         int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
> -         inev.ie.modifiers |= down_modifier;
> -         inev.ie.arg = list3 (make_fixnum (nchars),
> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> -
> -         if (mwheel_coalesce_scroll_events)
> -           dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
> -         else
> +         else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
>             {
> -             dpyinfo->scroll.acc_x = 0;
> -             dpyinfo->scroll.acc_y = 0;
> +             int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
> +             inev.ie.modifiers |= down_modifier;
> +             inev.ie.arg = list3 (make_fixnum (nchars),
> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> +
> +             dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
>             }
>         }
>      }

The patch doesn't apply.

-- 
Andrey Listopadov




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 06:12:02 GMT) Full text and rfc822 format available.

Message #32 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 14:11:01 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> On Wed, Dec 22, 2021 at 4:09 AM Po Lu <luangruo <at> yahoo.com> wrote:
>>
>> Po Lu <luangruo <at> yahoo.com> writes:
>>
>> > Andrey Listopadov <andreyorst <at> gmail.com> writes:
>> >
>> >> When `pixel-scroll-precision-mode' is disabled everything works fine.
>> >> When compiled without `--with-pgtk' but with `--with-xinput2'
>> >> `pixel-scroll-precision-mode' works as expected.
>> >
>> > Thanks, I will look into this now.
>>
>> Please try the following patch to see if it resolves your problem.
>> Thanks.
>>
>> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
>> index bd61c65edd..bea2650584 100644
>> --- a/src/pgtkterm.c
>> +++ b/src/pgtkterm.c
>> @@ -6133,78 +6133,64 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
>>      }
>>    else if (gdk_event_get_scroll_deltas (event, &delta_x, &delta_y))
>>      {
>> -      dpyinfo->scroll.acc_x += delta_x;
>> -      dpyinfo->scroll.acc_y += delta_y;
>> -      if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line
>> -         || !mwheel_coalesce_scroll_events)
>> +      if (!mwheel_coalesce_scroll_events)
>>         {
>> -         int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
>> -         inev.ie.kind = WHEEL_EVENT;
>> -         inev.ie.modifiers |= down_modifier;
>> -         inev.ie.arg = list3 (make_fixnum (nlines),
>> -                              make_float (-dpyinfo->scroll.acc_x * 100),
>> -                              make_float (-dpyinfo->scroll.acc_y * 100));
>> -         if (!mwheel_coalesce_scroll_events)
>> -           {
>> -             dpyinfo->scroll.acc_y = 0;
>> -             dpyinfo->scroll.acc_x = 0;
>> -           }
>> -         else
>> +         inev.ie.kind = ((fabs (delta_x) > fabs (delta_y))
>> +                         ? HORIZ_WHEEL_EVENT
>> +                         : WHEEL_EVENT);
>> +         inev.ie.modifiers = (inev.ie.kind == HORIZ_WHEEL_EVENT
>> +                              ? (delta_x >= 0 ? down_modifier : up_modifier)
>> +                              : (delta_y >= 0 ? down_modifier : up_modifier));
>> +         inev.ie.arg = list3 (Qnil, make_float (delta_x),
>> +                              make_float (delta_y));
>> +       }
>> +      else
>> +       {
>> +         dpyinfo->scroll.acc_x += delta_x;
>> +         dpyinfo->scroll.acc_y += delta_y;
>> +         if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line)
>>             {
>> +             int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
>> +             inev.ie.kind = WHEEL_EVENT;
>> +             inev.ie.modifiers |= down_modifier;
>> +             inev.ie.arg = list3 (make_fixnum (nlines),
>> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
>> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
>>               dpyinfo->scroll.acc_y -= dpyinfo->scroll.y_per_line * nlines;
>>             }
>> -       }
>> -      else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line
>> -              || !mwheel_coalesce_scroll_events)
>> -       {
>> -         int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
>> -         inev.ie.kind = WHEEL_EVENT;
>> -         inev.ie.modifiers |= up_modifier;
>> -         inev.ie.arg = list3 (make_fixnum (nlines),
>> -                              make_float (-dpyinfo->scroll.acc_x * 100),
>> -                              make_float (-dpyinfo->scroll.acc_y * 100));
>> -
>> -         if (!mwheel_coalesce_scroll_events)
>> +         else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line)
>>             {
>> -             dpyinfo->scroll.acc_y = 0;
>> -             dpyinfo->scroll.acc_x = 0;
>> +             int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
>> +             inev.ie.kind = WHEEL_EVENT;
>> +             inev.ie.modifiers |= up_modifier;
>> +             inev.ie.arg = list3 (make_fixnum (nlines),
>> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
>> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
>> +
>> +             dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
>>             }
>> -         else
>> -           dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
>> -       }
>> -      else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
>> -              || !mwheel_coalesce_scroll_events)
>> -       {
>> -         int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
>> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
>> -         inev.ie.modifiers |= up_modifier;
>> -         inev.ie.arg = list3 (make_fixnum (nchars),
>> -                              make_float (-dpyinfo->scroll.acc_x * 100),
>> -                              make_float (-dpyinfo->scroll.acc_y * 100));
>> -
>> -         if (mwheel_coalesce_scroll_events)
>> -           dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
>> -         else
>> +         else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
>> +                  || !mwheel_coalesce_scroll_events)
>>             {
>> -             dpyinfo->scroll.acc_x = 0;
>> -             dpyinfo->scroll.acc_y = 0;
>> +             int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
>> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
>> +             inev.ie.modifiers |= up_modifier;
>> +             inev.ie.arg = list3 (make_fixnum (nchars),
>> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
>> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
>> +
>> +             dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
>>             }
>> -       }
>> -      else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
>> -       {
>> -         int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
>> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
>> -         inev.ie.modifiers |= down_modifier;
>> -         inev.ie.arg = list3 (make_fixnum (nchars),
>> -                              make_float (-dpyinfo->scroll.acc_x * 100),
>> -                              make_float (-dpyinfo->scroll.acc_y * 100));
>> -
>> -         if (mwheel_coalesce_scroll_events)
>> -           dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
>> -         else
>> +         else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
>>             {
>> -             dpyinfo->scroll.acc_x = 0;
>> -             dpyinfo->scroll.acc_y = 0;
>> +             int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
>> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
>> +             inev.ie.modifiers |= down_modifier;
>> +             inev.ie.arg = list3 (make_fixnum (nchars),
>> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
>> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
>> +
>> +             dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
>>             }
>>         }
>>      }

> The patch doesn't apply.

That's odd.  Could you try updating your checkout, or failing that,
applying it manually?

Thanks.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 08:16:01 GMT) Full text and rfc822 format available.

Message #35 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 11:14:51 +0300
On Wed, Dec 22, 2021 at 9:11 AM Po Lu <luangruo <at> yahoo.com> wrote:
>
> Andrey Listopadov <andreyorst <at> gmail.com> writes:
>
> > On Wed, Dec 22, 2021 at 4:09 AM Po Lu <luangruo <at> yahoo.com> wrote:
> >>
> >> Po Lu <luangruo <at> yahoo.com> writes:
> >>
> >> > Andrey Listopadov <andreyorst <at> gmail.com> writes:
> >> >
> >> >> When `pixel-scroll-precision-mode' is disabled everything works fine.
> >> >> When compiled without `--with-pgtk' but with `--with-xinput2'
> >> >> `pixel-scroll-precision-mode' works as expected.
> >> >
> >> > Thanks, I will look into this now.
> >>
> >> Please try the following patch to see if it resolves your problem.
> >> Thanks.
> >>
> >> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
> >> index bd61c65edd..bea2650584 100644
> >> --- a/src/pgtkterm.c
> >> +++ b/src/pgtkterm.c
> >> @@ -6133,78 +6133,64 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
> >>      }
> >>    else if (gdk_event_get_scroll_deltas (event, &delta_x, &delta_y))
> >>      {
> >> -      dpyinfo->scroll.acc_x += delta_x;
> >> -      dpyinfo->scroll.acc_y += delta_y;
> >> -      if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line
> >> -         || !mwheel_coalesce_scroll_events)
> >> +      if (!mwheel_coalesce_scroll_events)
> >>         {
> >> -         int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> >> -         inev.ie.kind = WHEEL_EVENT;
> >> -         inev.ie.modifiers |= down_modifier;
> >> -         inev.ie.arg = list3 (make_fixnum (nlines),
> >> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> >> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> >> -         if (!mwheel_coalesce_scroll_events)
> >> -           {
> >> -             dpyinfo->scroll.acc_y = 0;
> >> -             dpyinfo->scroll.acc_x = 0;
> >> -           }
> >> -         else
> >> +         inev.ie.kind = ((fabs (delta_x) > fabs (delta_y))
> >> +                         ? HORIZ_WHEEL_EVENT
> >> +                         : WHEEL_EVENT);
> >> +         inev.ie.modifiers = (inev.ie.kind == HORIZ_WHEEL_EVENT
> >> +                              ? (delta_x >= 0 ? down_modifier : up_modifier)
> >> +                              : (delta_y >= 0 ? down_modifier : up_modifier));
> >> +         inev.ie.arg = list3 (Qnil, make_float (delta_x),
> >> +                              make_float (delta_y));
> >> +       }
> >> +      else
> >> +       {
> >> +         dpyinfo->scroll.acc_x += delta_x;
> >> +         dpyinfo->scroll.acc_y += delta_y;
> >> +         if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line)
> >>             {
> >> +             int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> >> +             inev.ie.kind = WHEEL_EVENT;
> >> +             inev.ie.modifiers |= down_modifier;
> >> +             inev.ie.arg = list3 (make_fixnum (nlines),
> >> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> >> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> >>               dpyinfo->scroll.acc_y -= dpyinfo->scroll.y_per_line * nlines;
> >>             }
> >> -       }
> >> -      else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line
> >> -              || !mwheel_coalesce_scroll_events)
> >> -       {
> >> -         int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> >> -         inev.ie.kind = WHEEL_EVENT;
> >> -         inev.ie.modifiers |= up_modifier;
> >> -         inev.ie.arg = list3 (make_fixnum (nlines),
> >> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> >> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> >> -
> >> -         if (!mwheel_coalesce_scroll_events)
> >> +         else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line)
> >>             {
> >> -             dpyinfo->scroll.acc_y = 0;
> >> -             dpyinfo->scroll.acc_x = 0;
> >> +             int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
> >> +             inev.ie.kind = WHEEL_EVENT;
> >> +             inev.ie.modifiers |= up_modifier;
> >> +             inev.ie.arg = list3 (make_fixnum (nlines),
> >> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> >> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> >> +
> >> +             dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
> >>             }
> >> -         else
> >> -           dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
> >> -       }
> >> -      else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
> >> -              || !mwheel_coalesce_scroll_events)
> >> -       {
> >> -         int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> >> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
> >> -         inev.ie.modifiers |= up_modifier;
> >> -         inev.ie.arg = list3 (make_fixnum (nchars),
> >> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> >> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> >> -
> >> -         if (mwheel_coalesce_scroll_events)
> >> -           dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
> >> -         else
> >> +         else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
> >> +                  || !mwheel_coalesce_scroll_events)
> >>             {
> >> -             dpyinfo->scroll.acc_x = 0;
> >> -             dpyinfo->scroll.acc_y = 0;
> >> +             int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> >> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
> >> +             inev.ie.modifiers |= up_modifier;
> >> +             inev.ie.arg = list3 (make_fixnum (nchars),
> >> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> >> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> >> +
> >> +             dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
> >>             }
> >> -       }
> >> -      else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
> >> -       {
> >> -         int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> >> -         inev.ie.kind = HORIZ_WHEEL_EVENT;
> >> -         inev.ie.modifiers |= down_modifier;
> >> -         inev.ie.arg = list3 (make_fixnum (nchars),
> >> -                              make_float (-dpyinfo->scroll.acc_x * 100),
> >> -                              make_float (-dpyinfo->scroll.acc_y * 100));
> >> -
> >> -         if (mwheel_coalesce_scroll_events)
> >> -           dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
> >> -         else
> >> +         else if (dpyinfo->scroll.acc_x <= -dpyinfo->scroll.x_per_char)
> >>             {
> >> -             dpyinfo->scroll.acc_x = 0;
> >> -             dpyinfo->scroll.acc_y = 0;
> >> +             int nchars = -dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
> >> +             inev.ie.kind = HORIZ_WHEEL_EVENT;
> >> +             inev.ie.modifiers |= down_modifier;
> >> +             inev.ie.arg = list3 (make_fixnum (nchars),
> >> +                                  make_float (-dpyinfo->scroll.acc_x * 100),
> >> +                                  make_float (-dpyinfo->scroll.acc_y * 100));
> >> +
> >> +             dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
> >>             }
> >>         }
> >>      }
>
> > The patch doesn't apply.
>
> That's odd.  Could you try updating your checkout, or failing that,
> applying it manually?
>
> Thanks.
>

Sorry, seems the mail got corrupted the first time I tried.

I've applied the patch, and now horizontal scrolling works correctly.
However, pressing Ctrl while scrolling doesn't register as `C-' event.
With `pixel-scroll-precision-mode` off, if I press C-h k and scroll in
any direction with the Ctrl key held down I get this:

There were several key-sequences:
  C-<wheel-up> at that spot runs the command mouse-wheel-text-scale
  C-<wheel-down> at that spot runs the command mouse-wheel-text-scale

(Since C-<wheel-left> and C-<wheel-right> aren't mapped to anything
they're not in the list)

With `pixel-scroll-precision-mode` on I get:

There were several key-sequences:
  <wheel-up> at that spot runs the command pixel-scroll-precision
  <wheel-down> at that spot runs the command pixel-scroll-precision
  <wheel-right> at that spot runs the command mwheel-scroll
  <wheel-left> at that spot runs the command mwheel-scroll
  <touch-end> runs the command pixel-scroll-start-momentum

So the scrolling works, but the Ctrl key is ignored now.  The same
happens with other modifier keys.

-- 
Andrey Listopadov




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 09:30:01 GMT) Full text and rfc822 format available.

Message #38 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 17:29:13 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

>   <wheel-up> at that spot runs the command pixel-scroll-precision
>   <wheel-down> at that spot runs the command pixel-scroll-precision
>   <wheel-right> at that spot runs the command mwheel-scroll
>   <wheel-left> at that spot runs the command mwheel-scroll
>   <touch-end> runs the command pixel-scroll-start-momentum

> So the scrolling works, but the Ctrl key is ignored now.  The same
> happens with other modifier keys.

Thanks, this issue should be fixed on master now.  Please test.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 13:26:02 GMT) Full text and rfc822 format available.

Message #41 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 16:24:58 +0300
[Message part 1 (text/plain, inline)]
>
> Thanks, this issue should be fixed on master now.  Please test.
>

Can confirm that the scrolling works as expected on current master.  Thanks!

-- 
Andrey Listopadov

>
[Message part 2 (text/html, inline)]

Reply sent to Po Lu <luangruo <at> yahoo.com>:
You have taken responsibility. (Wed, 22 Dec 2021 13:28:01 GMT) Full text and rfc822 format available.

Notification sent to Andrey Listopadov <andreyorst <at> gmail.com>:
bug acknowledged by developer. (Wed, 22 Dec 2021 13:28:02 GMT) Full text and rfc822 format available.

Message #46 received at 52685-done <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685-done <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 21:26:47 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

>  Thanks, this issue should be fixed on master now.  Please test.
>
> Can confirm that the scrolling works as expected on current master.
> Thanks!

Thanks for testing.  I'm closing this bug report.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 13:34:01 GMT) Full text and rfc822 format available.

Message #49 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 16:33:00 +0300
[Message part 1 (text/plain, inline)]
Sorry again, should have tested it a bit better before replying. On current
master the scroll is not only inversed, it is also super slow and works
only in the active window. Previously inactive windows were scrollable on
per line basis (e.g. not by pixels), now it is required to focus a window
for scrolling.  Am I missing some setting?
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 13:37:01 GMT) Full text and rfc822 format available.

Message #52 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 21:36:45 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> Sorry again, should have tested it a bit better before replying. On
> current master the scroll is not only inversed, it is also super slow
> and works only in the active window.  Previously inactive windows were
> scrollable on per line basis (e.g. not by pixels), now it is required
> to focus a window for scrolling.  Am I missing some setting?

No you're not, this is my fault.  Please try now with latest master.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Wed, 22 Dec 2021 13:49:02 GMT) Full text and rfc822 format available.

Message #55 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Wed, 22 Dec 2021 16:48:35 +0300
[Message part 1 (text/plain, inline)]
> No you're not, this is my fault.  Please try now with latest master.
>

Thanks!

Seems to work, with pixel scrolling mode enabled.  But when the mode is
disabled, the horizontal scrolling is inversed.  In other words, the
vertical direction is correct in both cases, horizontal is correct only
when pixel scrolling is on.


-- 
Andrey Listopadov

>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Mon, 10 Jan 2022 18:42:02 GMT) Full text and rfc822 format available.

Message #58 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Mon, 10 Jan 2022 21:40:20 +0300
after a recent update, horizontal scrolling is now reversed both when
pixel scrolling is enabled and disabled.  I've recompiled without the
`--with-pgtk' switch and horizontal scrolling is not reversed anymore.
Seems that some value needs to be negated on the pgtk side




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 11 Jan 2022 00:56:01 GMT) Full text and rfc822 format available.

Message #61 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 11 Jan 2022 08:54:56 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

> after a recent update, horizontal scrolling is now reversed both when
> pixel scrolling is enabled and disabled.  I've recompiled without the
> `--with-pgtk' switch and horizontal scrolling is not reversed anymore.
> Seems that some value needs to be negated on the pgtk side

Could you explain what "reversed" means in this context?  Which events
are sent when you scroll with your fingers moving leftwards?  And
rightwards?

Perhaps you just need to set mouse-wheel-tilt-scroll to t.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 11 Jan 2022 04:18:02 GMT) Full text and rfc822 format available.

Message #64 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when compiled with pgtk
Date: Tue, 11 Jan 2022 04:16:50 +0000
>Could you explain what "reversed" means in this context?  Which events
>are sent when you scroll with your fingers moving leftwards?  And
>rightwards?
>
>Perhaps you just need to set mouse-wheel-tilt-scroll to t.

I have this setting enabled. I also have mouse-wheel-flip-direction set to t.

The problem is, that the same touchpad movement scrolls text in different directions when Emacs is compiled with and without pgtk support with the same init file.

When compiled without pgtk, its behavior configured in my init file matches all system apps, and when compiled with the pgtk support it is inversed.

Both pgtk and non-pgtk builds send rhe same events, but scroll in different directions.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 11 Jan 2022 04:23:02 GMT) Full text and rfc822 format available.

Message #67 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when compiled with pgtk
Date: Tue, 11 Jan 2022 04:22:44 +0000
>I also have mouse-wheel-flip-direction set to t.
Oh, I just realized, that perhaps I don't need this setting on the pgtk build, as it probably respects the operating system settings for natural scrolling? Non-pgtk build probably didnt, and this is why I needed the setting in the first place?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 11 Jan 2022 04:41:01 GMT) Full text and rfc822 format available.

Message #70 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Andrey Listopadov <andreyorst <at> gmail.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 11 Jan 2022 12:39:45 +0800
Andrey Listopadov <andreyorst <at> gmail.com> writes:

>>I also have mouse-wheel-flip-direction set to t.
> Oh, I just realized, that perhaps I don't need this setting on the
> pgtk build, as it probably respects the operating system settings for
> natural scrolling? Non-pgtk build probably didnt, and this is why I
> needed the setting in the first place?

That could be the case, yes.
I will look into this a little further.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52685; Package emacs. (Tue, 11 Jan 2022 05:41:02 GMT) Full text and rfc822 format available.

Message #73 received at 52685 <at> debbugs.gnu.org (full text, mbox):

From: Andrey Listopadov <andreyorst <at> gmail.com>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Yuuki Harano <masm+emacs <at> masm11.me>, 52685 <at> debbugs.gnu.org
Subject: Re: bug#52685: 29.0.50; Horizontal scrolling doesn't work when
 compiled with pgtk
Date: Tue, 11 Jan 2022 08:39:40 +0300
I've tried building Emacs without pgtk support, and it turns out that
it also respects the system settings for natural scrolling.  So the
horizontal scrolling is indeed inversed on the pgtk build.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 08 Feb 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.