Mouse cursor disappearing after changing it multiple times

Mouse cursor disappearing after changing it multiple times. When you do it often enough and there is no way to get it back. We are using the same JmeCursor object instance. And setting it simply with com.jme3.input.InputManager inputManager.setMouseCursor().

We are changing it often depending on what the user interaction is. I wonder if the problem is the same as:

I also tested with LWJGL 3. And the same problem exists. The problem is present in both JME 3.0 and 3.1.

Woah, a stack appeared after awhile:

Jul 23, 2016 2:41:14 PM com.jme3.input.lwjgl.LwjglMouseInput setNativeCursor
SEVERE: null
org.lwjgl.LWJGLException: Could not allocate DIB section.
    at org.lwjgl.opengl.WindowsDisplay.nCreateCursor(Native Method)
    at org.lwjgl.opengl.WindowsDisplay.doCreateCursor(
    at org.lwjgl.opengl.WindowsDisplay.createCursor(
    at org.lwjgl.input.Cursor.createCursors(
    at org.lwjgl.input.Cursor.<init>(
    at com.jme3.input.lwjgl.LwjglMouseInput.setNativeCursor(
    at com.jme3.input.InputManager.setMouseCursor(
    at toniarts.openkeeper.view.PlayerInteractionState.setCursor(
    at toniarts.openkeeper.view.PlayerInteractionState.onMouseMotionEvent(
    at com.jme3.input.InputManager.processQueue(
    at com.jme3.input.InputManager.update(
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(

When the stacks start to appear the application is completely frozen. Before that only the cursor disappears which is a major inconvenience but the app remains usable otherwise.

Should I open a GitHub issue on this?

It does look exactly related to the bug you mention in the first post.

I took that as an approval :sweat:

Are you sure you can reproduce it in LWJGL3?

Because it does use the caching:

From build.gradle:

jmonkeyengine_version = '[3.1,)'
compile "org.jmonkeyengine:jme3-lwjgl3:$jmonkeyengine_version"

Hmm, you are right. Last time I tried I was sure I was using LWJGL3 too. Maybe I blew the testing then. Now when I tried, the cursor didn’t disappear. But all of our cursors were flipped and in weird palette (+ animated cursor doesn’t work). I don’t remember this from my previous tests.