From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Smoother macOS touchpad scrolling Date: Sat, 9 Sep 2017 09:18:05 +0100 Message-ID: <20170909081805.GA20275@breton.holly.idiocy.org> References: <20170908184634.GA20058@breton.holly.idiocy.org> <86y3pox258.fsf@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1504945114 17039 195.159.176.226 (9 Sep 2017 08:18:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Sep 2017 08:18:34 +0000 (UTC) User-Agent: Mutt/1.7.2 (2016-11-26) Cc: Emacs-Devel devel To: Tak Kunihiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 09 10:18:23 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqay0-0003SX-CE for ged-emacs-devel@m.gmane.org; Sat, 09 Sep 2017 10:18:16 +0200 Original-Received: from localhost ([::1]:48623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqay6-0003oP-PR for ged-emacs-devel@m.gmane.org; Sat, 09 Sep 2017 04:18:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqaxx-0003lv-Ei for emacs-devel@gnu.org; Sat, 09 Sep 2017 04:18:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqaxu-0004zy-Bw for emacs-devel@gnu.org; Sat, 09 Sep 2017 04:18:12 -0400 Original-Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:36547) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqaxt-0004xY-PZ for emacs-devel@gnu.org; Sat, 09 Sep 2017 04:18:09 -0400 Original-Received: by mail-wr0-x22d.google.com with SMTP id o42so7571464wrb.3 for ; Sat, 09 Sep 2017 01:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=goNJ6oKKEdK4I2b8vF7ZKy/oot3Lf1jpNJA9aVteZLE=; b=XlhadmJy6kX5ASWd9/UNWgUzph+JNyQ9t7UW780wKll/pMqzYpJjaFX0+eTa2aqg3f c4HYWBFk3dFmxTUhTjomzNQMBLKT9+p/cbXykqVIv3ZkFcbuzHiTAJ+BlsZqs9xgZWFS OUAZs8smOs3gDPQ+Q7MktvNhj5Ws2YX6Q7jx8lTQ9WELYqJ9bDaWlI6EM1ir5UAMH686 J9JzK7B42RxOnqmZrUzRTaMSJR7fWS3gX12WhafllA8BN3ofXEeZJlrBSiUibqtHVucJ V9Ci0XdoofL+Y0+mGL0ATa1YEgLD2bqyI7b94WCyYWcv9uJcdYSNYyxj0B2x7ur9tX2d uDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=goNJ6oKKEdK4I2b8vF7ZKy/oot3Lf1jpNJA9aVteZLE=; b=VY9qZmsSiH0Fd+I0Kibx1n5mBsIc/j3Yn5WYI5a0Px0TXpOubb6QY0oZg/T0C5ouCI 79k7HyeorkQ6madTn9st0hyjPrrZh3V+FY/LsqqZgIg1uYN4aj/b9E8IkcOXVcfy2k0q gALj94tMaigVQ4YltlGAxDbafVE3MEpQLEuzQVSgEBaw9XsWD4nv29/oAtfH/Il5L+qR aj1r8HmC6qQFvubh9e24znu7yItKgNjTjJ0xRxlYO8ydtK2OCAeC1sMMg4p1eKYZ9ieQ td3cxHEXA78KEzUiKBA2Cv6EZSLW1OoDd4NYyjKpLVr70VvLxsGWvrofFDEee5buNo+w F9Uw== X-Gm-Message-State: AHPjjUiOKLkhmcIjEr/3rwd+lzDqr+lqRAFQrwh6klFoBKba6oj0SoLz Sm5oBeddPGTvlg== X-Google-Smtp-Source: ADKCNb63UdQYhGpCYqaE+uxYX/um34kkVgo4ywIvrLrRQp/ft5/MvGwUmVI4zOqpweiNtB+KRhaCpw== X-Received: by 10.223.186.75 with SMTP id t11mr4261828wrg.165.1504945088761; Sat, 09 Sep 2017 01:18:08 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-d5ca-64a5-495a-0a85.holly.idiocy.org. [2001:8b0:3f8:8129:d5ca:64a5:495a:a85]) by smtp.gmail.com with ESMTPSA id e18sm3841736wma.43.2017.09.09.01.18.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Sep 2017 01:18:07 -0700 (PDT) Content-Disposition: inline In-Reply-To: <86y3pox258.fsf@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218045 Archived-At: On Sat, Sep 09, 2017 at 07:21:23AM +0900, Tak Kunihiro wrote: > > +(setq mouse-wheel-scroll-amount '(1 ((shift) . 5))) > > +(setq mouse-wheel-progressive-speed nil) > > I thought one of good things about your patch is to make scrolling smooth > without changing default. No? > > http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00624.html That was the plan, but I’ve run into some difficulties: https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00013.html This patch is a compromise between trying to improve the experience on macOS and not adding new features that we don’t have under X. I think progressive speed needs to be off, however, as macOS adds its own acceleration. If you leave it on, then you’re doubling up on progressive scrolling. Probably the scroll amount change should be removed from this patch, though. > > + int lineHeight = default_line_pixel_height(XWINDOW (FRAME_SELECTED_WINDOW (emacsframe))); > > A buffer with images has lines with different height. > I think lineHeight should be > - height of 1 line (or sum of 5 lines) at the top on a screen > when scrolling up > - height of unseen 1 line (or sum of unseen 5 lines) above the > top out of screen when scrolling down. I considered this but couldn’t find an easy way to get that information in C. There probably is, I just couldn’t find it. I also don’t think it’s too important as we’re not doing real pixelwise scrolling. I considered just using a constant value, like 10, as I think that would still provide a better experience than we have currently. The reason I didn’t use a constant is in cases where the user zooms out, or otherwise has very small text on the screen, they might expect the scrolling to move more lines in that case. (Although, with more experimentation, I don’t think default_line_pixel_height does what I thought it did, as making the text very small or very big doesn’t seem to change the scrolling behaviour.) Additionally, if you do have a *very* large image on a line, then it could look as though scrolling is not actually doing anything. If the consensus is that using the actual line heights is preferable, then I’m happy to make that change. -- Alan Third