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.devel Subject: Re: master e37eb7f: Add support for pixel wheel deltas on NS Date: Fri, 26 Nov 2021 10:17:44 +0200 Message-ID: <83zgpr2uvr.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28040"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 26 09:18:51 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 1mqWRV-00072g-5g for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 09:18:49 +0100 Original-Received: from localhost ([::1]:59226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqWRT-0002kX-F9 for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 03:18:47 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqWQQ-00021E-Dp for emacs-devel@gnu.org; Fri, 26 Nov 2021 03:17:42 -0500 Original-Received: from [2001:470:142:3::e] (port=48710 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 1mqWQQ-0003sN-4a; Fri, 26 Nov 2021 03:17:42 -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=BkGDxwg6sJLtVEv0PAu6TPmphRkuO+cSVLKniQMHzm8=; b=Q9foOs4GL9ig y/uC6porcSfF0eDmO4dY9bWkD/AG/AEhNnEF7W2vzmvjL17/YcRLR33JzlliDKmX5Us1oAe0Jnjfo QCRIl0y94W5G7J+uf+vLB4sVxMFj70EKk7NVJBy/oP1JwmslCP026bi0RvDj4qeFjxsZt3bsVwzkf qNNtyWpA016xHItwZCcPNtfkZTgE78w+WhNOXkuma91H2d8ZJ8cgjU8ohs4LlizVI19lf7xkjHFgb idIngrIKBoaNwJqRErhTmzs2PriFP6LQqV8CvecHyPu1f2S+ct7Y7uhPv1u4Mnxd3mvw01IjWsmIG YBspBaE5WZjkL2LluaOECw==; Original-Received: from [87.69.77.57] (port=1503 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 1mqWQO-0002z7-Px; Fri, 26 Nov 2021 03:17:42 -0500 In-Reply-To: <87wnkvflk7.fsf@yahoo.com> (message from Po Lu on Fri, 26 Nov 2021 15:00:40 +0800) 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:280208 Archived-At: > From: Po Lu > Cc: rpluim@gmail.com, emacs-devel@gnu.org > Date: Fri, 26 Nov 2021 15:00:40 +0800 > > > What is "precision scroll information", and how does it differ from > > the information we receive from the mouse wheel on MS-Windows today? > > AFAICT, we already get a window-system message for every movement of > > the mouse wheel, so what else is needed? > > Basically, we need to expose not only whether or not the mouse wheel has > been scrolled, but exactly how much it has been scrolled, each time a > wheel event is sent. > > We expose it to Lisp as the amount of pixels the text should be scrolled > in each axis, as that is the most common format used by modern window > systems. How to compute the amount of pixels for a given amount of wheel delta? The wheel delta on MS-Windows is reported in abstract units, not directly related to any pixels, AFAICT. I don't see the logic of the conversion to pixels documented anywhere in the X or NS code, and the comments, such as they are, make no sense at all to someone who knows nothing about X mouse-wheel handling. In xterm.c, it seems like some kind of query of the device "valuators" (whatever that is) is being used? And on NS, it seems like the delta is already reported in pixels? So I'm still in the dark here. (We really need to document our algorithms better, unless we assume only GUI experts will read and maintain them.)