[core/engine] Ensure that full updates still take place regularly
Ensure that a full update still happens, even if continuous scrolling triggers new events (and therefore, partial updates) all the time. see #353
This commit is contained in:
parent
2b91ce5861
commit
23be352ec3
1 changed files with 5 additions and 2 deletions
|
@ -265,13 +265,16 @@ class Engine(object):
|
|||
"""Start the event loop"""
|
||||
self._output.start()
|
||||
event = None
|
||||
last_full = time.time()
|
||||
interval = float(self._config.get("interval", 1))
|
||||
while self.running():
|
||||
if event:
|
||||
if event and time.time() - last_full < interval:
|
||||
self.patch_output(event)
|
||||
else:
|
||||
last_full = time.time()
|
||||
self.write_output()
|
||||
if self.running():
|
||||
event = self.input.wait(float(self._config.get("interval", 1)))
|
||||
event = self.input.wait(interval)
|
||||
|
||||
self._output.stop()
|
||||
self.input.stop()
|
||||
|
|
Loading…
Reference in a new issue