Multithreading Issue: UI freezes while dragging

Hi,

I’m new to PyQt5 as well as multi-threading. I literally copied and pasted the code in this article into a python file and ran it using VsCode’s powershell. It worked perfectly: the UI was not affected at all by the background task. However, when I copied the same code into another file in a Linux environment, all of the sudden, when drag the window around the screen, the on-screen counter and background threading task both freeze. When I release my mouse, the counter skips ahead a few seconds and resumes counting. This does not occur using my file in the windows OS and powershell. Is there something about Linux that handles UI events differently? How can I get my window to update independently of the background task?

The only other difference between environments besides OS is python versions and PyQt5 versions:

Working Environment Versions (powershell):
QT_VERSION_STR: 5.15.2
PYQT_VERSION_STR: 5.15.10
sys.version (python): 3.11.9

Not Working Environment Versions (Linux):
QT_VERSION_STR: 5.15.2
PYQT_VERSION_STR: 5.15.10
sys.version (python): 3.8.19

Any help is GREATLY appreciated