Processing 3.5.1 / Mac OSX Mojave with 2 screens.
When the window is move to the other screen the sketch start to blink.
void setup() {
size(400,400,P2D); // blinking when the window is move to an other screen
// size(400,400,P3D); // blinking when the window is move to an other screen
// size(400,400,JAVA2D); // ok
// size(400,400,FX2D); // ok
// size(400,400); // ok
}