LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Jakes on August 01, 2023, 06:08:42

Title: Issues while using custom/disabled/hidden cursor
Post by: Jakes on August 01, 2023, 06:08:42
I'm currently having issues with the rendering canvas (repainting invocations) each time I change the cursor mode in any way, either by using glfwSetInputMode or Component.setCursor() or even glfwSetCursor.
Each time any cursor mode/type that isnt GLFW_CURSOR_NORMAL and Cursor.getDefaultCursor() the repaint of the Canvas gets called way less often while the mouse is moving across the surface of the canvas.
While the mouse is moving no rendering happens whatsoever.

I've tried to debug this, it seems to be comming from the event dispatcher.

My code structure:

RenderClass extends Canvas
- init: JAWT_GetDrawingSurface, JAWTWin32DrawingSurfaceInfo.create, glfwAttachWin32Window, glfwMakeContextCurrent, createCapabilities,
- draw cycle: JAWT_DrawingSurface_Lock, <Render Code>, glfwSwapBuffers, glfwPollEvents, JAWT_DrawingSurface_FreeDrawingSurfaceInfo, JAWT_DrawingSurface_Unlock, [b]repaint[/b];


now, when I call any of these 2 lines of code:
canvas.setCursor(CURSOR_HIDDEN); -> set custom cursor to invisible one
glfwSetInputMode(Inputs.hwnd, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -> hides the cursor


while moving the mouse the renderer stops from repainting, only to resume when no mouse is stopped, as you can see on the example:
https://i.imgur.com/GjWEyHl.mp4

Is there any known issue on this matter?

Note: This behaviour gets more noticeable when more hardware accelerated applications are running (like, google chrome with youtube, steam, video player, etc)

Regards