Creating detached windows

I’ve seen similar errors on Linux and also tried to createBufferStrategy(), but failed. The two offending lines of code are removeNotify() and setUndecorated(). Thanks for the feedback; now we have a good idea where the problem lies if we can just figure out how to fix it.

Addendum: Changed source code to create undecorated frame immediately after getting frame and canvas and added addNotify(). Also deleted the line to offset the canvas. Mouse handlers switched to canvas from frame; these changes appeared to markedly reduce error messages and will now run on Linux:

   PApplet.runSketch(new String[] {this.getClass().getSimpleName()}, this);
    frame = ((processing.awt.PSurfaceAWT.SmoothCanvas) surface.getNative()).getFrame();
    canvas = (processing.awt.PSurfaceAWT.SmoothCanvas) surface.getNative();  
    frame.removeNotify();
    frame.setUndecorated(true);
    frame.addNotify();
    frame.setLocation(x, y);

canvas.addMouseListener(new MouseAdapter() {...}

canvas.addMouseMotionListener(new MouseMotionAdapter() {...}