This doesn't happen every time, but it happens often enough to be annoying.
Using these steps I could get almost 100% reproducibility:
When cursor is above the unfocused kitty, it disappears.

I saw you use i3 too, can you reproduce?
I have the same problem on archlinux + i3 too.
i3 4.15.0.1
Kitty 0.8.4.
Apparently this bug is related to mouse_hide_wait option, which has a default value of 3.0.
The workaround is to set mouse_hide_wait 0 in the config.
I haven't seen it as far as I can recall, and if you set mouse_hide_wait to zero you disable hiding of the mouse cursor, which will of course prevent the mouse cursor from ever being hidden.
Looking at the code, I dont see any possibility of a bug in kitty. kitty calls show_mouse_cursor() whenever glfw reports any mouse event. SO even if the mouse cursor is hidden, simply moving it around will call show_mouse_cursor(). This can be easily verified by putting printf() into show_mouse_cursor() and hide_mouse() in glfw.c
From looking at glfw's mouse handling code, you might need to click in the window first, because only if it is focused does glfw allow changing the mouse visibility.
That is true, the bug happens only with unfocused windows - and when I click on the window to bring it back to focus, the cursor will immediately show up.
So it seems the bug cannot be fixed due to glfw's limitations of changing the cursor visibility for non-focused windows?
Sure it can be fixed, one just has to fix glfw :)
For instance, this patch should take care of it, since as far as I can tell the requirement that the window be focused to change the mouse cursor is Apple only:
diff --git a/glfw/input.c b/glfw/input.c
index e78a8c12..0a1b1f0f 100644
--- a/glfw/input.c
+++ b/glfw/input.c
@@ -620,7 +620,9 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* handle, int mode, int value)
&window->virtualCursorPosX,
&window->virtualCursorPosY);
+#ifdef __APPLE__
if (_glfwPlatformWindowFocused(window))
+#endif
_glfwPlatformSetCursorMode(window, value);
}
else if (mode == GLFW_STICKY_KEYS)
Huh, I thought the glfw is an external library 馃檪 I confirm that it does fix the issue!
It is an external library, kitty just has its own forked copy with various improvements.
Reported upstream as: https://github.com/glfw/glfw/issues/1247