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 101bbd1392: Add support for pinch gestures to the XI2 build Date: Sun, 26 Dec 2021 12:31:12 +0200 Message-ID: <83h7avpsi7.fsf@gnu.org> References: <83r19zq0l9.fsf@gnu.org> <87fsqf65u4.fsf@yahoo.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10104"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 26 11:32:06 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 1n1Qov-0002Qp-EW for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 11:32:05 +0100 Original-Received: from localhost ([::1]:41120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1Qot-0000pS-AL for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 05:32:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1Qnq-0008Rp-NQ for emacs-devel@gnu.org; Sun, 26 Dec 2021 05:31:01 -0500 Original-Received: from [2001:470:142:3::e] (port=49876 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 1n1Qnq-0005Qv-Cv; Sun, 26 Dec 2021 05:30:58 -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=5eo1qZvp3CWKLfQLxY5IHlr7Q6CG8VwonsNH0dEa5SY=; b=lRlCCJU5rGI2 JnD/30p+ZhdO75RbmkfaW03Z2lWeYtcK7mnpn24zdV5ePZ5FzNMWgpWWN3DH1c2XhqmICJqygQHy3 2nPuLGAprCh1XX6vs3Moy1yO/egGfn6VkEoxI2uuZsJk0TFG/udxGRH8XJ+maXZ2W3R/a/C0B7YfV H1a4tpi3e24pkKrp1pgo1pGVBk6L8Os8/rpZuDuntfOdtmkuGsKtr5zyMxCUduln85XDbCf9Q4Rob ZYJbFeVJX5BPrfCUDVA/J62NClg0UceaSfRRnpPJPrpPgxkxVMLVjp/rNqAcYSRWlgARsC86u72jn /lLIGCJWZZjwu8e0X7XuYQ==; Original-Received: from [87.69.77.57] (port=4977 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 1n1Qnp-0004I0-SA; Sun, 26 Dec 2021 05:30:58 -0500 In-Reply-To: <87fsqf65u4.fsf@yahoo.com> (message from Po Lu on Sun, 26 Dec 2021 18:03:31 +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:283277 Archived-At: > From: Po Lu > Cc: emacs-devel@gnu.org > Date: Sun, 26 Dec 2021 18:03:31 +0800 > > > And I think this kind of event is too high-level. Usually, pinch > > (a.k.a. "zoom") gestures and rotation gestures are reported > > separately, because they have different semantics and will probably > > have different command bindings. Why should be lump them together? > > Moreover, in the corresponding command you require that the rotation > > angle be zero, something that will be hard on the users, I think. > > XInput doesn't yet have support for reporting rotation gestures; the > angle here is only reported as part of a pinch sequence, and pinch > sequence only started when actual pinching occurs. Yes, but you could generate several Emacs events in make_lispy_event, can't you? Or maybe simply ignore the angle data? > > We could potentially be flooded with input messages, and the question > > is whether the above command should process all the pending events of > > this time at once? If it should, perhaps keyboard.c should fetch all > > the consecutive pinch events and produce a single event out of it, or > > at least produce a structure that supplies all the events as one form > > to the application level? > > > At least for text-scale, I think you will have a lot of unpleasant > > flickering if you process each event separately. > > I didn't notice that, but it's because we round the result of the > scaling. I will try to fix this, thanks. > > However, I think TRT here is not for keyboard.c to "coalesce" these > events: the best approach would probably be to use `read-event' inside > individual user commands with a timeout. That way, the commands > themselves get to decide the granularity of the gestures they receive. I don't think I understand how read-event with a timeout will help here: you still get a series of events, AFAIU. Besides, I think doing such processing in Lisp is not the best way, because the facilities are quite crude and not meant for doing this. Walking the event queue looking a for a series of pinch events is much easier. > > Finally, as this is a user command, we should start documenting such > > commands in the user manual. > > Thanks, where would you prefer to put it? In "Text Scale", I guess (which currently doesn't document mouse-wheel-text-scale, which it should).