Screen and portions of screen going black

This started randomly happening. I was watching some downloaded YouTube videos when I first noticed it. At first I just assumed they were blank parts in the video, but it was happening too much. So I looked at what was going on on the other virtual desktops. I saw the java emulator Z64K in one of the virtual desktops. So I closed it and the system seemed to return to normal. I didn’t close it because I suspected it. It was just a whim. It had probably been sitting there inactive for quite a while, with no issues.