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(WindowsDisplay.java:721)
    at org.lwjgl.opengl.WindowsDisplay.createCursor(WindowsDisplay.java:717)
    at org.lwjgl.input.Cursor.createCursors(Cursor.java:207)
    at org.lwjgl.input.Cursor.<init>(Cursor.java:107)
    at com.jme3.input.lwjgl.LwjglMouseInput.setNativeCursor(LwjglMouseInput.java:158)
    at com.jme3.input.InputManager.setMouseCursor(InputManager.java:421)
    at toniarts.openkeeper.view.PlayerInteractionState.setCursor(PlayerInteractionState.java:549)
    at toniarts.openkeeper.view.PlayerInteractionState.onMouseMotionEvent(PlayerInteractionState.java:252)
    at com.jme3.input.InputManager.processQueue(InputManager.java:827)
    at com.jme3.input.InputManager.update(InputManager.java:907)
    at com.jme3.app.LegacyApplication.update(LegacyApplication.java:725)
    at com.jme3.app.SimpleApplication.update(SimpleApplication.java:227)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:193)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
    at java.lang.Thread.run(Thread.java:745)

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.