| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 035bf30 commit ab3c696
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,7 +96,16 @@ def _on_timer(self): | |||
| 96 | 96 | # if _timer is None, this means that _timer_stop has been called; so | |
| 97 | 97 | # don't recreate the timer in that case. | |
| 98 | 98 | if not self._single and self._timer: | |
| 99 | - self._timer = self.parent.after(self._interval, self._on_timer) | ||
| 99 | + if self._interval: | ||
| 100 | + self._timer = self.parent.after(self._interval, self._on_timer) | ||
| 101 | + else: | ||
| 102 | + # Edge case: Tcl after 0 *prepends* events to the queue | ||
| 103 | + # so a 0 interval does not allow any other events to run. | ||
| 104 | + # This incantation is cancellable and runs as fast as possible | ||
| 105 | + # while also allowing events and drawing every frame. GH#18236 | ||
| 106 | + self._timer = self.parent.after_idle( | ||
| 107 | + lambda: self.parent.after(self._interval, self._on_timer) | ||
| 108 | + ) | ||
| 100 | 109 | else: | |
| 101 | 110 | self._timer = None | |
| 102 | 111 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments