From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master e37eb7f: Add support for pixel wheel deltas on NS Date: Fri, 26 Nov 2021 19:44:59 +0800 Message-ID: <877dcvf8ec.fsf@yahoo.com> References: <20211125030922.2353.1129@vcs0.savannah.gnu.org> <20211125030924.7258E2094B@vcs0.savannah.gnu.org> <871r34h6pi.fsf@gmail.com> <87fsrkzfq1.fsf@yahoo.com> <83tug05whz.fsf@gnu.org> <87tufzycli.fsf@yahoo.com> <837dcv4e79.fsf@gnu.org> <87wnkvflk7.fsf@yahoo.com> <83zgpr2uvr.fsf@gnu.org> <87fsrjfeb1.fsf@yahoo.com> <83r1b32lvr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: rpluim@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 26 12:46:40 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mqZgd-0002ZD-Uj for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 12:46:40 +0100 Original-Received: from localhost ([::1]:59002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqZgc-0006yH-Hp for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 06:46:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqZfE-0006AV-6u for emacs-devel@gnu.org; Fri, 26 Nov 2021 06:45:12 -0500 Original-Received: from sonic313-56.consmr.mail.ne1.yahoo.com ([66.163.185.31]:43080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqZfC-0005t6-LQ for emacs-devel@gnu.org; Fri, 26 Nov 2021 06:45:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637927109; bh=5xVU6lT9LByzuK5Q+LSXNNqxw1M3s0Y2uAXtoGfBBwU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=fGmqo/Mt0gjC1Mp5z13m5dqlsqaj7J+AurFk8lLEmM8/r2QKijP4PpuYeRLzbzNZ+xxc0Hn1kWdxMd3+Z9fWQmAM5agy/T9mh57/68rGq3lcTaga6j/uQkrvFW5KbEXpBr2fhHwUBHt6iPk13K0jxS6p+PbT81KSSAOKUt32B8fJIqgje97c83IkKU+bU1AoqAmcunYK7L1dJlnyS4y0cDCYLmqFqoq/L8AxAV8xw2uoLw9WsnSPmnneDD2MXSWdivhLmcLxv1Z5OFZNfwVGgZiYFB+L9i8AZJjfXy8F1LtDU1rAYX9YNgC7kQcWLKE+jiQ1gpUDBFH97sMT7RdcUA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637927109; bh=VEaU3wHp84yLGhrGaFHPHXB45CFCh0+09JXgDzo5UYM=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=r0bxlgjVUY18QU+lU0Lhpp2mH/25WNc7lNYlbvCu6PJ3bzpt4rvN8/6QRrk6GW2ZtZkOV4LTvU9bC2g1LfhFT0LyJzFDVOMdqqxTq3/f2X09rHGWVZM1uB4jPWe34lw85TMgJczfTsc3E0rY9Ld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Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Fri, 26 Nov 2021 11:45:09 +0000 Original-Received: by kubenode519.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 5010a07d03149e04a929dd49c990eab1; Fri, 26 Nov 2021 11:45:04 +0000 (UTC) In-Reply-To: <83r1b32lvr.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Nov 2021 13:32:08 +0200") X-Mailer: WebService/1.1.19306 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.185.31; envelope-from=luangruo@yahoo.com; helo=sonic313-56.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280220 Archived-At: Eli Zaretskii writes: > Thanks. But if this conversion is arbitrary (see below), I think I > know how to implement the MS-Windows version of "arbitrary". Thanks! I really appreciate it. >> On X, the states of the mouse wheels in each axis are stored as absolute >> values inside "valuators" attached to each mouse device. To obtain the >> delta of the scroll wheel from a motion event (which is used to report >> that some valuator has changed), it is necessary to iterate over every >> valuator that changed, and compare its previous value to the current >> value of the valuator. >> >> Each individual valuator also has an "interval", which is the amount you >> must divide that delta by in order to obtain a delta in the terms of >> scroll units. >> >> This delta however is still intermediate, to make driver implementations >> easier. The XInput developers recommend the following algorithm to >> convert from scroll unit deltas to pixel deltas: >> >> pixels_scrolled = pow (window_height, 2.0 / 3.0) * delta; > > All of this should be in comments in xterm.c. > > Btw, the code calculates pixels_scrolled when it is not yet clear that > the value will be used, which is a waste of cycles, AFAICT. How about > moving this closer to where the value is actually used? I'll do that, thanks. > In any case, are you saying that the conversion to pixels is somewhat > arbitrary? And that users of X based systems have no control on this > conversion, i.e. users cannot determine the pixel equivalent of each > "delta"? Yes, I'm using the method recommended by the XInput 2 developers, and on X-based systems there's no option to control that arbitrary behaviour that I know of. It seems to be that every X-Windows program I checked (which includes non-GTK programs such as Mozilla Firefox and Qt) also computes the pixel information the same way. >> Yes. The PGTK port can do something similar if it gains support for >> this, as GTK also reports it in pixels directly. > Same question here: do users have any system-wide control on the > conversion to pixels under these environments? I don't know about NS, but there's no such option in GTK based systems.