Your problem is located either inside WindowServer
or Finder
processes.
The problem might come from 3 different sources:
- memory corruption (but this would strike on other programs)
- application corruption and this might come from:
- an old disk causing errors on one of this files upon heating
- a corruption within one of these files showing up upon a large use of internal structures.
To identify a potential error on your disk (case 2.1) I advise you to run
Disk Utility
on mode Verify Disk
many times so as to make it heat until the correct status eventually change.
To identify which program is running (case 2.2) when you see this bug, I advise you to run Activity Monitor
and try to kill (with the button ✕) each of these programs to verify which one of the 2 is the culprit.
Once you identified it, you will have to replace it with a correct backup. If you don't have one, it will be easier to reinstall the System.
But don't do this as an automatic measure without first first checking what is the original cause of your problem.