jME Canvas slows down the whole system when not in focus

When my app is running if I click in other Swing component and then try to move or resize the window the mouse cursor freezes, everything together get very slow. If the canvas is focused it doesn’t happen. Also I can’t run 2 instances of the same app in the same machine because it slows down everything so much. What happens when a canvas lose focus? Why this severe slow down?



Thanks.

You can try limiting the framerate (settings.setFrameRate(30) or 60), you can also enable pause on lost focus (app.setPauseOnLostFocus(true)). Those will reduce CPU usage of your canvas significantly.

Even though it is pausing when losing focus it still keeps slowing down the whole system, heh, I just tested it and when not pausing it, the system is more responsive :slight_smile: that is crazy eh. Setting the frame rate to 30 or 60 makes it much much better, almost doesn’t use CPU. Solved.



Thanks.