From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Campbell Barton Newsgroups: gmane.emacs.devel Subject: Re: Support for explicitly resetting the idle timer? Date: Sat, 27 Nov 2021 19:42:15 +1100 Message-ID: References: <1d3c782b-6e79-8deb-e34d-f53b94f2fd9c@gmail.com> <83bl2610wt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1231"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 27 09:43:05 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 1mqtIT-000AYm-Dp for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 09:43:01 +0100 Original-Received: from localhost ([::1]:42310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqtIS-0002Kx-8L for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 03:43:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqtHy-0001fQ-1w for emacs-devel@gnu.org; Sat, 27 Nov 2021 03:42:30 -0500 Original-Received: from [2607:f8b0:4864:20::102b] (port=53813 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqtHw-00028J-Jh; Sat, 27 Nov 2021 03:42:29 -0500 Original-Received: by mail-pj1-x102b.google.com with SMTP id iq11so8654634pjb.3; Sat, 27 Nov 2021 00:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bBOcRRB9aW/6dEY/zJbfPdCrDL28PrCPKK4Wwzh8qMg=; b=aozGU8UymD5HMi6Wg8PQ8FHPEmUnYeobEmJ5GjwRcUqtn7TZq447HfdANykz6J6no4 BHNswI3crStcO9lmxhRcb8eraSOKlc36Xa/ex6yzs6Pt8sbChRkXluUSURktH2RKd8cX DlpAMQqSq6iP2KLsmQjFKGCYm+PQx6SjxQZinhsyQbmPJPceV/92vOlXdOmiSEUKlaaT PiQFl98OoqfDg3k5Z0ks9AnmDSQv1cKc9P/SxzBOUT7uGvB0X7vEVu5H+Gj+BPT1+dqJ ixJBxmoyudez36rWMmaPPNlCAINeXQNk5wtdrPSoW5b6ch7XrPrWzLLOIZW65cg9GIzj 8SQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bBOcRRB9aW/6dEY/zJbfPdCrDL28PrCPKK4Wwzh8qMg=; b=4j6R+zNrdDYvB5cEtVEsqJ7OZVtVxhuPFaiRMIhQSEZDsJcgo9UgovMOLzvm/6DtXL gUcbMeoz/nfVnScl9MjNJaIFYM3TnjwpPv3Xtn1hL9UO3b/iCr6L+bBnUm5HyN+Wlxh8 P3MSrKdZF/OztnE1JlejuX+Q1gkjUMi7z1BGD3J8ttzomlmnY7oTCq3GFjK5ZB8fRo9H D3as2zfjWpkS/WfQ8MudiR9KDuPL9JSjHh3I8+2NnsHV19seh+Bc+nos8DFy1hkjLEs+ hZ08s/gfZU0zYmVjMaUL1X+BkXKp1OfXbKNj6YKTjaH7g6PXj1hODgxcQGJ91WIVSSpZ IvNg== X-Gm-Message-State: AOAM533IF/O+Q5ogjw00a/MmeRsvot81uDUOvZ4RSvPSeQx1eDjcnTov BQEMv4qu60IPuq40Txg//B1QVNk44bmzgkyHHpSCrIZ68cM= X-Google-Smtp-Source: ABdhPJx57NjrsvAm9WFfu5QPn60yPUrs9VvCNO6uWm9Kdc4y6UBgH8LhjdTXUy3UVXZtPGMJnCdzPUAtvmtIqFK2FQo= X-Received: by 2002:a17:90a:974a:: with SMTP id i10mr21771683pjw.117.1638002546966; Sat, 27 Nov 2021 00:42:26 -0800 (PST) In-Reply-To: <83bl2610wt.fsf@gnu.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=ideasman42@gmail.com; helo=mail-pj1-x102b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:280307 Archived-At: On Sat, Nov 27, 2021 at 7:02 PM Eli Zaretskii wrote: > > > Date: Sat, 27 Nov 2021 18:54:56 +1100 > > From: Campbell Barton > > > > There is a package I use/maintain which implements something like > > Firefox's auto-scroll (click-drag to scroll up/down) [0]. > > > > An issue with this is (unlike mouse wheel scrolling) using track-mouse > > doesn't handle keyboard events in a way that resets the idle timer. > > > > So while scrolling, idle timers may run (which can cause visible > > stuttering). > > > > I've worked around this by locally let binding `timer-idle-list` to nil, > > however this back-fires if any timers are added while scrolling (rare > > but possible), workarounds for this are possible - but they involve > > clearing the list while scrolling then moving the contents into the real > > `timer-idle-list` list... which as far as I can see is quite error > > prone, especially if packages are inspecting the contents of this list. > > > > All this complexity could be avoided if the function `timer_stop_idle` > > in ./src/keyboard.c was exposed to elisp, this way scripts that use > > mouse input could explicitly reset the idle timer on mouse based > > user-interaction (when it makes sense). > > The cleanest solution in this case would be to call timer_stop_idle if > Emacs is executing a command, no matter how it was invoked. In fact, > I'm surprised that we don't stop idle timers when track-mouse invokes > commands: it sounds like a bug we should fix. Not sure if this would solve my case (is there some formal definition of what is meant by a command?). I'm changing the scroll position using `set-window-vscroll` - so I'm not sure if that counts as a command. As a workaround it may be possible to define a dummy command that does nothing but reset the idle timer. -- - Campbell