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#51891: 29.0.50; [PATCH] Pixel delta support for wheel events on X Date: Thu, 18 Nov 2021 09:33:51 +0200 Message-ID: <83tug9yl28.fsf@gnu.org> References: <87zgq4uvh0.fsf.ref@yahoo.com> <87zgq4uvh0.fsf@yahoo.com> <871r3gnrrn.fsf@gmail.com> <875ysrtyak.fsf@yahoo.com> <871r3ftsjy.fsf@yahoo.com> <83r1bezz2u.fsf@gnu.org> <87r1beqpy8.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40421"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, 51891@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 18 08:35:10 2021 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 1mnbwr-000AKd-BQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 08:35:09 +0100 Original-Received: from localhost ([::1]:45472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnbwq-0008Sw-2c for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Nov 2021 02:35:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnbwk-0008Sn-CA for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 02:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mnbwk-0003n6-3h for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 02:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mnbwj-0003hL-ST for bug-gnu-emacs@gnu.org; Thu, 18 Nov 2021 02:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Nov 2021 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51891-submit@debbugs.gnu.org id=B51891.163722084414113 (code B ref 51891); Thu, 18 Nov 2021 07:35:01 +0000 Original-Received: (at 51891) by debbugs.gnu.org; 18 Nov 2021 07:34:04 +0000 Original-Received: from localhost ([127.0.0.1]:34546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnbvo-0003fY-5T for submit@debbugs.gnu.org; Thu, 18 Nov 2021 02:34:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnbvl-0003f2-U8 for 51891@debbugs.gnu.org; Thu, 18 Nov 2021 02:34:03 -0500 Original-Received: from [2001:470:142:3::e] (port=38312 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnbvg-0003el-JL; Thu, 18 Nov 2021 02:33:56 -0500 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=EJUCmpnHIo/S1gRgqbOs+RaaiHmWDSoqPiCuggZSE5Q=; b=Ko88G8N27FSN vVqaJBZHESJ5FGzD0Je4w1/aJmQyFJO3Ebfg9VbMV+Hd4TlAImZJWXQ6FhMZqjlnxtgH/mtg3cU60 XZnl4XMowzNqeJMxlDR8WedUphOVqt8t6jRo4nwiEniZ3IGw2uuIPsDU5IeKSrDxpXokFQC6OVEbi yAoI38b57atHvpfWC9L3aW3Dgrs+pWcLg2OaqMhOFrAeHjdt5BOLc2svvXptkIZXg/PEK86KJHeUs r3pXWO4sS4I7gNzE5AtbYCnwqVGsbUjziUtdwaSTmlgX45Bk8l5JN6sFv5wlMHXc+ht9mii5hqAKG xOMqhbFrnjvP8W6uyTmvWA==; Original-Received: from [87.69.77.57] (port=1442 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnbvf-00055X-Rg; Thu, 18 Nov 2021 02:33:56 -0500 In-Reply-To: <87r1beqpy8.fsf@yahoo.com> (message from Po Lu on Thu, 18 Nov 2021 08:15:27 +0800) 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" Xref: news.gmane.io gmane.emacs.bugs:220267 Archived-At: > From: Po Lu > Cc: rpluim@gmail.com, 51891@debbugs.gnu.org > Date: Thu, 18 Nov 2021 08:15:27 +0800 > > > And finally, why introduce keyword-value pairs into a form that didn't > > use them before? Can we store just the values there? > > Different window systems might have more/different information. For > instace, I can imagine the GTK port wanting to include scroll phase and > inertia data into this propertly list. A Lisp object could have different types, one each for every use case we want to support. For example, we could use a single object there, which in your case will be a list of 2 values, and in other cases will have more members. We do this kind of stuff all the time, including in specifying POSITION in various events -- there are a gazillion of different forms of POSITION already in Emacs. I see no reason to change the format when all we need to do is add one more form of POSITION. > >> + scroll_unit = pow (FRAME_PIXEL_HEIGHT (f), 2.0 / 3.0); > > > Ouch! can we avoid calling 'pow' here? It's an expensive function. > > That's what the other big users of XInput 2 do, including GTK+ and > Mozilla Firefox, and is unfortunately the only method of obtaining true > pixel scroll data from a scroll valuator. Sorry, I don't understand: XInput2 knows about FRAME_PIXEL_HEIGHT of our frames? > >> + DEFVAR_BOOL ("x-coalesce-scroll-events", x_coalesce_scroll_events, > >> + doc: /* Non-nil means to only send one wheel event for each scroll unit. > >> +Otherwise, a wheel event will be sent every time the mouse wheel is > >> +moved. > > > This is confusing: what does "scroll unit" mean in this context? > > An amount of scrolling that would previously generate a `mouse-4' or > `mouse-5' event. That doesn't really answer my question. Let me ask it differently: how does "scroll unit" differ from "every time the wheel is moved"? > But since I think most people don't know what such button events are, > it would not be sufficient to just put that into the doc string. > > Any ideas? I might have ideas once I understand what you are trying to say ;-)