From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65070: 29.1; (Only on Windows) Both touchpad scroll gestures scroll the screen up and down. Date: Sat, 19 Aug 2023 10:54:34 +0300 Message-ID: <83cyzj1n7p.fsf@gnu.org> References: <85lee88fej.wl--xmue@d1.dion.ne.jp> <83v8dc2on4.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6735"; mail-complaints-to="usenet@ciao.gmane.io" Cc: hiroya.ebine1@gmail.com, max@mal-richtig.de, 65070@debbugs.gnu.org To: Kazuhiro Ito Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 19 09:55:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qXGnf-0001Vw-QI for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Aug 2023 09:55:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qXGnX-0000CH-22; Sat, 19 Aug 2023 03:55:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXGnV-0000Bt-5z for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 03:55:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXGnU-00009k-UL for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 03:55:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qXGnV-0003nI-Pr for bug-gnu-emacs@gnu.org; Sat, 19 Aug 2023 03:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Aug 2023 07:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65070 X-GNU-PR-Package: emacs Original-Received: via spool by 65070-submit@debbugs.gnu.org id=B65070.169243167414545 (code B ref 65070); Sat, 19 Aug 2023 07:55:01 +0000 Original-Received: (at 65070) by debbugs.gnu.org; 19 Aug 2023 07:54:34 +0000 Original-Received: from localhost ([127.0.0.1]:49298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXGn3-0003mV-HM for submit@debbugs.gnu.org; Sat, 19 Aug 2023 03:54:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qXGn1-0003mJ-IV for 65070@debbugs.gnu.org; Sat, 19 Aug 2023 03:54:32 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qXGmt-0008Kz-54; Sat, 19 Aug 2023 03:54:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IBn3ca5Fstlokzfum9zNJEd99pw4hJMQNW8iVMfW+4A=; b=BSDqFZHKjnVF ScgYIk/VJhJlG05cu78inxaIaDypryJdgsLmUokJNwTKAfIAs/ORZTEUuQ+Xep0XL20kCJ6MFByPn uDgpaJd6jDmKHX2DIasoL+kT9nhL+MtkwKxT39bmZ8j+FORnqZZVDcE19xOXS7+ub5D/Roea5jA8d NMTFkUodDIgoKU5hnEYHLHOSeV0Skzp1O9VkQDnsDmoUpVKoSf6rwmRJLESVqeYeahzeZKQQrTX/D ZTkawt7al6Sgd8RFu2+vGabDLg2FZ9foh8XlicMqeobmIAuW3R0D5/F48XBoW4xfXx0/7MAwzBOmN 4S9MzW8WAuhSafPffVyJig==; In-Reply-To: (message from Kazuhiro Ito on Sat, 19 Aug 2023 07:54:47 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267819 Archived-At: > Date: Sat, 19 Aug 2023 07:54:47 +0900 > From: Kazuhiro Ito > Cc: 65070@debbugs.gnu.org, > hiroya.ebine1@gmail.com, > max@mal-richtig.de > > > > I noticed that when I input wheel-down with touchpad, line count is > > > set to negative value, which should be positive integer. > > > > > > (let ((event (read-event))) > > > (cons (car event) (event-line-count event))) > > > > > > ;; Input via touchpad > > > (wheel-down . -3) > > > (wheel-up . 3) > > > > > > ;; Input via mouse wheel > > > (wheel-down . 1) > > > (wheel-up . 1) > > > > Thanks. Can you show the complete data of the events in both the > > mouse and the touchpad cases? > > ;; touchpad > (wheel-down (# 385 (308 . 211) 300986031 nil 385 (38 . 9) nil (4 . 13) (8 . 22)) 1 -3 (0.0 . -79.75)) > (wheel-up (# 158 (225 . 76) 300920437 nil 158 (28 . 3) nil (129 . 10) (8 . 22)) 1 3 (0.0 . 76.45)) > > ;; mouse wheel > (wheel-down (# 101 (237 . 26) 300913750 nil 101 (29 . 1) nil (5 . 4) (8 . 22))) > (wheel-up (# 159 (275 . 101) 300906703 nil 159 (34 . 4) nil (275 . 13) (8 . 22))) Thanks. Does the patch below help? Also, can you try this with mwheel-coalesce-scroll-events set to nil and report the events Emacs gets in that case and the effect it produces on scrolling with the touchpad and the mouse wheel? Po Lu, I'd appreciate if you'd take me through the code that produces and uses these wheel events, documented in the ELisp reference manual as (wheel-up/down POSITION CLICKS LINES PIXEL-DELTA). Specifically: . what is the conventions for signs in the data of the PIXEL-DELTA cons cell? . where and how are the PIXEL-DELTA data used for scrolling? The corresponding X code is incomprehensible for me, as it deals with concepts and values I cannot relate to the corresponding Windows functionalities. (I think the xterm.c code which deals with pixel-wise scrolling could use some detailed commentary, regardless.) And the ELisp manual doesn't divulge enough detail, either. So your help will be appreciated. diff --git a/src/w32term.c b/src/w32term.c index 2899e82..40b04b1 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3412,7 +3412,7 @@ w32_construct_mouse_wheel (struct input_event *result, W32Msg *msg, ((double)FRAME_LINE_HEIGHT (f) * scroll_unit) / ((double)WHEEL_DELTA / delta); nlines = value_to_report / FRAME_LINE_HEIGHT (f) + 0.5; - result->arg = list3 (make_fixnum (nlines), + result->arg = list3 (make_fixnum (eabs (nlines)), make_float (0.0), make_float (value_to_report)); }