Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent flicker in 'QtReConsoleMonitor' #194

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions bluesky_widgets/qt/run_engine_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2777,9 +2777,11 @@ def __init__(self, model, parent=None):
self._start_thread()
self._start_timer()

self._updating_text = False

def _start_timer(self):
# Timer is used to initiate periodic updates of the QTextEdit widget
QTimer.singleShot(200, self._update_console_output)
QTimer.singleShot(195, self._update_console_output)

def _finished_receiving_console_output(self):
self._start_thread()
Expand Down Expand Up @@ -2842,10 +2844,14 @@ def _process_new_console_output(self, result):

def _update_console_output(self):
if self._text_updated:
self._text_updated = False
self._adjust_text_list_size()
self._display_text()

if not self._updating_text:
try:
self._updating_text = True
self._text_updated = False
self._adjust_text_list_size()
self._display_text()
finally:
self._updating_text = False
self._start_timer()

def _display_text(self):
Expand Down
Loading