I was trying to play around with the new windowResizable() and other related functions added in processing 4. however I found that sometimes after resizing the window the sketch would stop redrawing, mouse click also didn’t work. The window didn’t close and I could keep resizing it however the new window space that was created was just black. I created another thread and that didn’t get stopped when the sketch froze and was able to detect when the main thread stopped executing.
code that I was testing
void setup(){
size(400,400);
windowResizable(true);
thread("nt");
}
int lt=0;
void draw(){
background(100);
println(width+" "+height+" "+frameCount);
fill(random(-16777215,0));
rect(width/2,height/2,100,100);
lt=millis();
}
void windowResized(){
println("window resized");
}
void windowMoved(){
println("window moved");
}
void mouseClicked(){
println("peepee poopoo");
}
void nt(){
while(true){
random(1);
if(millis()-lt>100){
println("wee woo");
}
}
}
does anyone know why this might be happening?