From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: [Emacs Master d277123f4bf] pixel-scroll-precision-scroll-up-page feels pause, but pixel-scroll-precision-scroll-down-page is smooth Date: Tue, 3 Sep 2024 14:14:35 -0400 Message-ID: <73E3A3FA-A1AB-40EB-87B9-80BB8902682A@gmail.com> References: <34bff610-732e-4c52-9574-35a4bab8223d@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29406"; mail-complaints-to="usenet@ciao.gmane.io" To: Eval EXEC , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 03 20:16:12 2024 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 1slY4Z-0007V9-Dr for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Sep 2024 20:16:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slY3I-0005t5-Ad; Tue, 03 Sep 2024 14:14:52 -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 1slY3G-0005mK-JE for emacs-devel@gnu.org; Tue, 03 Sep 2024 14:14:50 -0400 Original-Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slY3D-0001XB-TJ for emacs-devel@gnu.org; Tue, 03 Sep 2024 14:14:49 -0400 Original-Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-457ea6560a3so4925941cf.2 for ; Tue, 03 Sep 2024 11:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725387287; x=1725992087; darn=gnu.org; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=OUP1EUJ09LxXnFMKe/1013rh1BsrMfYi7M35i4fXNk0=; b=d+UZUECr8M7f71FKo1cA6fZRl68Z/M6KaB450QAbM5eEJkT33B25vJKZqurYMu1qcU k7MI1GaIKMoWUKWqQ9Oz8k/C6wmcEEwlzlbp0zxE3Nuugv80NMgjU7m5953EDlfO+s3x 7c34u2p6WrMbO057RnkueHZCf2SeVSE87t8kGcXK3AIeyBBnqArbi1T0gwNzbFaljN1y BdTM2ky+B37vSRftL9JJhZruyDRoTEFcwbG1hWu3dSGby/2d/VcoBDBBH5KAOR2E9Vt4 apVPstB4fJr/zDrcDjYnlAk6cHMOgKhrN7HQH63Vq1NT2CInruV60LA8rQaEbsbxOWtR rmNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725387287; x=1725992087; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OUP1EUJ09LxXnFMKe/1013rh1BsrMfYi7M35i4fXNk0=; b=hvUMtsJ7eSLl+/0MzH0f/V9O5wZ+xxr6sB/BDFydXQkYcWHJhSC9Ofta/uO3Hb3ZEW jrxKum7io0wgyGb37EWreMLCwVnIpSktcn4tLnzFfvwkSbIlPto9fINaZrCEqi+l/DkS k3gGxzYorORcmn7tQIa0m1AAKFaoEqGKGH2lqlokHLRnM83hnAEtxTg8MMqnVRiqzISS 6XvMXNhR+9GfFwL3j42i077LtNQHJ8S2EcB1fmL1SiWZOWoRC/rZw9bQWuvwo5LL6UNf CcGLUIoMxQ0ZB0yZkVvBbghNn8sIsUID4FTnli5qoVZGVoMFobhS0iabKCOH/TfhogQe hbTQ== X-Forwarded-Encrypted: i=1; AJvYcCWnM7LTZukSb1uW5Qu9JkgwFNYRS4t/iO8gVrM+NYXTKFlunk7KA8COnHZ/Mly6x590+ReayF6TWTXxiw==@gnu.org X-Gm-Message-State: AOJu0Ywv3eascwTdDGQZR1BfbC/m/dEU3Hu0nHIuL3c9Af9wIOL+3FD5 OouFzw7X8oksuQ7J2WYKBAIUNU76LFiWApCOBCvBL68DpqT10tw1X5BAYw== X-Google-Smtp-Source: AGHT+IGbBWV7AIW0RlajFjITZSGOwTse5hoR4JIr5eQgMnrWn5moF8rDicCI+pp3vuYM50NdgWlMKQ== X-Received: by 2002:a05:622a:5a89:b0:457:21ed:bd11 with SMTP id d75a77b69052e-457e2ddcf64mr49066931cf.37.1725387286684; Tue, 03 Sep 2024 11:14:46 -0700 (PDT) Original-Received: from smtpclient.apple ([131.183.131.33]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45682ced1c3sm52444121cf.54.2024.09.03.11.14.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Sep 2024 11:14:46 -0700 (PDT) In-Reply-To: <34bff610-732e-4c52-9574-35a4bab8223d@gmail.com> X-Mailer: Apple Mail (2.3774.600.62) Received-SPF: pass client-ip=2607:f8b0:4864:20::82f; envelope-from=jdtsmith@gmail.com; helo=mail-qt1-x82f.google.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323341 Archived-At: > On Sep 3, 2024, at 5:56=E2=80=AFAM, Eval EXEC = wrote: >=20 > Then I open a rust project. >=20 > use touchpad to scroll up and down. When I use touchpad to = `triple-wheel-up`, I feel very lag and pause. >=20 > When I `triple-wheel-down`, it's very smooth. >=20 >=20 > Why `pixel-scroll-precision-scroll-up-page` is very lag and pause, but = `pixel-scroll-precision-scroll-down-page` is very smooth? This asymmetry is inherent to vscroll, which, although very fast, is = only available "below" the displayed screen contents. To quote the FAQ = of my ultra-scroll-mac[1] package: =E2=80=A2 Scrolling asymmetry: =E2=80=A2 vscroll is purely one-sided: you can only access a = vscroll area beneath the current window view; there is no negative = vscroll. =E2=80=A2 Unlike window-start, window-end does not get updated = promptly between redisplays and cannot always be trusted. =E2=80=A2 For these two reasons, smooth scrolling up and = scrolling down are not symmetric with each other (and will likely never = be). You need different approaches for each. =E2=80=A2 If the two approaches for scrolling up and down = perform quite differently, the user will feel this difference. The algorithms employed in ultra-scroll-mac are (in my testing) = measurably faster than the ones in pixel-scroll-precision (from which it = was inspired), although up is still slower than down. They also enable = smooth scrolling past images which are taller than the window. See the = functions `ultra-scroll-mac-up/down'. =20 Unfortunately this package only works on the Carbon emacs-mac port, = which exposes rich scroll events with pixel-level delta data. But the = core scroll algorithms could potentially be adapted to = pixel-scroll-precision-mode, and I'd be happy to contribute them if = anyone takes this up. I have also wondered whether other systems like = Linux/GTK have standard APIs for delivering high-speed touchpad events, = which would allow pixel-scroll-precision to get out of the business of = simulating these. [1] https://github.com/jdtsmith/ultra-scroll-mac