all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Support for explicitly resetting the idle timer?
@ 2021-11-27  7:54 Campbell Barton
  2021-11-27  8:02 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Campbell Barton @ 2021-11-27  7:54 UTC (permalink / raw)
  To: Emacs developers

Hi, I've run into a situation where being able to reset the idle time is 
needed. As far as I can tell there is no way to do this at the moment.
So I'm writing to check if a patch to support this is likely to be 
considered.

To give some context for how I ended up needing this, the motivation for 
this is noted below.


Motivation
==========

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).

Other solutions could work too (perhaps something specific to 
`track-mouse`), but I think having a way to reset the idle timer is most 
straightforward.

[0]: https://gitlab.com/ideasman42/emacs-scroll-on-drag




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-27 11:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-27  7:54 Support for explicitly resetting the idle timer? Campbell Barton
2021-11-27  8:02 ` Eli Zaretskii
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.