processing4 icon indicating copy to clipboard operation
processing4 copied to clipboard

Freezing on window resize on Windows

Open Galbi3000 opened this issue 3 years ago • 5 comments

I was going through the changelog for the version 4 betas and decided to quickly try the windowRatio example:

void setup() {
  windowResizable(true);
  windowRatio(1280, 720);

  cursor(CROSS);
  strokeWeight(10);
}

void draw() {
  background(240);
  fill(255);
  rect(0, 0, rwidth, rheight);

  fill(0);
  textAlign(CENTER, CENTER);
  textSize(200);
  text(rmouseX + ", " + rmouseY, rwidth/2, rheight/2);
}

When I run it I get a small window showing the mouse co-ordinates scaled to 1280, 720 as expected. However, when I resize the window it freezes completely, it will not even respond to the X button to close the window. I have to use Task Manager to kill the process after which I get the following error in the IDE:

Could not run the sketch (Target VM failed to initialize).
For more information, read Help ? Troubleshooting.
  • Processing version: 4.0b8
  • Operating System and version: Windows 11 Pro Version 22H2 Build 22621.160
  • Other info: I do use Window FX 6 by Stardock that on a very slim chance might cause an issue but I have never encountered any as of yet. Its window management features are turned off anyway, just a few features are on with nothing enabled to do with resizing.

Galbi3000 avatar Jun 26 '22 19:06 Galbi3000

I can reproduce the issue on Microsoft Windows 10 Home N, Version 10.0.19044 Build 19044 (no WindowsFX installed).

Then I tried to make the smallest sketch that reproduces the error.

This runs fine:

void setup(){
  windowResizable(true);
}

This crashes when resizing:

void setup(){
  windowResizable(true);
}

void draw(){
}

Note: The sketch can be closed with the stop button.

SableRaf avatar Sep 23 '22 18:09 SableRaf

Yeah, I've been seeing it consistently on Windows, though I'm also confused because I thought I had it working properly at some point during the alpha/beta process for 4.

benfry avatar Sep 23 '22 19:09 benfry

Seems like there is a check for sketch.isLooping() missing in the resize listener of SurfaceAWT's frame. This fixes the resizing issue, not crashing the app anymore. But the sketch itself won't resize, like it is doing with P2D or P3D.

66-m avatar Sep 26 '22 17:09 66-m

https://github.com/processing/processing4/issues/629#issuecomment-1593618488

retiutut avatar Jun 16 '23 20:06 retiutut

the main problem for me is that P2D fixes it, but the P2D renderer is very unstable for me for some reason, causing issues that i don't have with Java2D i hope this gets fixed soon because this is one of the biggest issues with Java2D for me right now

grimtin10 avatar Nov 25 '23 08:11 grimtin10