<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 6 February 2018 at 05:21, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This looks like a libinput bug (well, it does say "libinput bug" on the<br>
package) but it hasn't been that for a long time. The cause is almost always<br>
insufficient motivation to call libinput_dispatch() by the caller, or at least<br>
not doing it with the celerity libinput demands (and deserves, if I may say<br>
so).<br>
<br>
Up-, down- or side-grade it to a client bug, so the outrage can be<br>
directed elsewhere, preferably away from me. And add a section to the<br>
documentation, just in case someone actually reads this stuff.<br></blockquote><div><br></div><div>Brilliant commit message :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Peter Hutterer <<a href="mailto:peter.hutterer@who-t.net">peter.hutterer@who-t.net</a>><br>
---<br>
doc/faqs.dox | 22 ++++++++++++++++++++++<br>
src/timer.c | 8 ++++----<br>
2 files changed, 26 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/doc/faqs.dox b/doc/faqs.dox<br>
index f0d85859..d5190926 100644<br>
--- a/doc/faqs.dox<br>
+++ b/doc/faqs.dox<br>
@@ -198,4 +198,26 @@ href="<a href="https://www.freedesktop.org/software/systemd/man/hwdb.html" rel="noreferrer" target="_blank">https://www.freedesktop.<wbr>org/software/systemd/man/hwdb.<wbr>html</a>">udev<br>
hwdb</a> or patches that include a change to the hwdb. See @ref hwdb for<br>
details on the hwdb and how to modify it locally.<br>
<br>
+@section faq_timer_offset What causes the "timer offset negative" warning?<br>
+<br>
+libinput relies on the caller to call libinput_dispatch() whenever data is<br>
+available on the epoll-fd. Doing so will process the state of all devices<br>
+and can trigger some timers to be set (e.g. palm detection, tap-to-click,<br>
+disable-while-typing, etc.). Internally, libinput's time offsets are always<br>
+based on the event time of the triggering event.<br>
+<br>
+For example, a touch event with time T may trigger a timer for the time T +<br>
+180ms. When setting a timer, libinput checks the wall clock time to ensure<br>
+that this time T + offset is still in the future. If not, the warning is<br>
+logged.<br>
+<br>
+When this warning appears, it simply means that too much time has passed<br>
+between the event occuring (and the epoll-fd triggering) and the current<br></blockquote><div><br></div><div>My spell-checker claims 2 “r” in “occurring”</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+time. In almost all cases this is an indication of the caller being<br>
+overloaded and not handling events as speedily as required.<br>
+<br>
+The warning has no immediate effect on libinput's behavior but some of the<br>
+functionality that relies on the timer may be impeded (e.g. palms are not<br>
+detected as they should be).<br>
+<br>
*/<br>
diff --git a/src/timer.c b/src/timer.c<br>
index f8de6662..584673a0 100644<br>
--- a/src/timer.c<br>
+++ b/src/timer.c<br>
@@ -86,10 +86,10 @@ libinput_timer_set_flags(<wbr>struct libinput_timer *timer,<br>
uint64_t now = libinput_now(timer->libinput);<br>
if (expire < now) {<br>
if ((flags & TIMER_FLAG_ALLOW_NEGATIVE) == 0)<br>
- log_bug_libinput(timer-><wbr>libinput,<br>
- "timer %s: offset negative (-%dms)\n",<br>
- timer->timer_name,<br>
- us2ms(now - expire));<br>
+ log_bug_client(timer-><wbr>libinput,<br>
+ "timer %s: offset negative (-%dms)\n",<br>
+ timer->timer_name,<br>
+ us2ms(now - expire));<br>
} else if ((expire - now) > ms2us(5000)) {<br>
log_bug_libinput(timer-><wbr>libinput,<br>
"timer %s: offset more than 5s, now %d expire %d\n",<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br></font></span></blockquote><div><br></div><div>From someone who dealt with such a reported issue with gnome-shell recently, it looks good to me!</div><div><br></div><div>With the missing “r” in the doc section, it's:</div><div><br></div><div>Reviewed-by: Olivier Fourdan <<a href="mailto:ofourdan@redhat.com">ofourdan@redhat.com</a>> </div><div><br></div><div>Cheers,</div><div>Olivier</div></div></div></div>