Skip to content

Calling windowResize() with multiple PApplet instances running destabilizes the sketch #629

Closed
@processing-bot

Description

@processing-bot

Created by: onimatrix

Description

Modifying the MultipleWindows example to use P3D for the main window and JAVA2D for the child one, plus doing a windowResize in the ChildApplet::draw() method, leaves the child window frozen.

ChildApplet childA;

void setup()
{
  size(400, 300, P3D);    
  childA = new ChildApplet();
}

class ChildApplet extends PApplet
{
  ChildApplet()
  {
    super();
    PApplet.runSketch(new String[] { this.getClass().getName() }, this);
  }

  void settings()
  {
    size(400, 300);
  }

  void setup()
  {
    windowResizable(true);
  }

  void draw()
  {
    println("frame #" + frameCount);
    windowResize(width + 1, height); 
  }
}

There's a second, (maybe related?) issue, where calling windowMove and windowResize on a simple sketch's draw() triggers an exception with every frame for P2D and P3D, and freezes completely in JAVA2D

void settings()
{
  size(400, 300, P2D);
}

void setup()
{
  windowResizable(true);
}

void draw()
{
  windowMove(20, 20);
  println("frame #" + frameCount);
  windowResize(width + 1, height); 
}

It seems that calling windowMove before calling windowResize is what triggers the issue here.
If I move windowMove to setup() instead, it only triggers the issue once and then resizes successfully (but remains frozen in JAVA2D)

Thank you for your time!

Your Environment

This is happening on Windows 10 with Processing 4.1.1.

Possible Causes / Solutions

Might be related to #507?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions