!fixup: GUI: Avoid scrolling back on msg window every second

This commit is contained in:
deajan 2025-03-05 09:51:42 +01:00
parent 105e30385d
commit 697adba8a1

View file

@ -332,14 +332,14 @@ def gui_thread_runner(
if time.monotonic() - start_time > 1:
if len(stdout_cache) > 1000:
stdout_cache = stdout_cache[-1000:]
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
if (
previous_stdout_cache != stdout_cache
or previous_stderr_cache != stderr_cache
):
_update_gui_from_cache(stdout_cache, stderr_cache)
previous_stdout_cache = stdout_cache
previous_stderr_cache = stderr_cache
# Don't update GUI if there isn't anything to update so it will avoid scrolling back to top every second
if (
previous_stdout_cache != stdout_cache
or previous_stderr_cache != stderr_cache
):
_update_gui_from_cache(stdout_cache, stderr_cache)
previous_stdout_cache = stdout_cache
previous_stderr_cache = stderr_cache
start_time = time.monotonic()
_update_gui_from_cache(stdout_cache, stderr_cache)