From: Eli Zaretskii <eliz@gnu.org>
To: Campbell Barton <ideasman42@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Support for explicitly resetting the idle timer?
Date: Sat, 27 Nov 2021 10:02:42 +0200 [thread overview]
Message-ID: <83bl2610wt.fsf@gnu.org> (raw)
In-Reply-To: <1d3c782b-6e79-8deb-e34d-f53b94f2fd9c@gmail.com> (message from Campbell Barton on Sat, 27 Nov 2021 18:54:56 +1100)
> Date: Sat, 27 Nov 2021 18:54:56 +1100
> From: Campbell Barton <ideasman42@gmail.com>
>
> 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.
next prev parent reply other threads:[~2021-11-27 8:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 7:54 Support for explicitly resetting the idle timer? Campbell Barton
2021-11-27 8:02 ` Eli Zaretskii [this message]
2021-11-27 8:42 ` Campbell Barton
2021-11-27 9:01 ` Eli Zaretskii
2021-11-27 9:14 ` Campbell Barton
2021-11-27 10:11 ` Eli Zaretskii
2021-11-27 10:21 ` Campbell Barton
2021-11-27 10:54 ` Eli Zaretskii
2021-11-27 11:16 ` Campbell Barton
2021-11-27 11:33 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83bl2610wt.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=ideasman42@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).