From 23be352ec30ce5aeb9423d8aad8ecfca77cb7d12 Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Sat, 19 Jan 2019 14:18:48 +0100 Subject: [PATCH] [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 --- bumblebee/engine.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bumblebee/engine.py b/bumblebee/engine.py index 6c4cff5..fb6a7d3 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -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()