Sketch soft crashes when resizing window

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(){

int lt=0;
void draw(){
  println(width+" "+height+" "+frameCount);

void windowResized(){
  println("window resized");

void windowMoved(){
  println("window moved");

void mouseClicked(){
  println("peepee poopoo");

void nt(){
     println("wee woo");

does anyone know why this might be happening?

1 Like

Hello @jSdCool,

Related topic:


that is not the issue that I am having here
the issue is not that it flickers it is that the image stops updating entirely

Hello @jSdCool,

I shared a related topic and the solution that solved the flicker solved the issue here.

W10 and Processing 4.01 tested.


I tried adding delay to my sketch and it did not fix the problem
I don’t know why it would solve the problem when the problem is that the sketch stop executing entirely after the window is resized.
additionally the window is not resized from inside the sketch but by the user at any point.

where exactly did you change things to fix it?