hide the browser cursor if imgui is handling software cursor rendering

This commit is contained in:
SlowRiot 2026-04-02 23:03:29 +01:00
parent 4d012cfda2
commit b452984bca

View File

@ -425,6 +425,12 @@ void update_cursor(ImGui_ImplEmscripten_Data* bd)
ImGuiIO& io{ImGui::GetIO()};
if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) return;
if (io.MouseDrawCursor) // hide the cursor for the entire window if imgui is handling cursor drawing - not just when imgui wants to capture the mouse
{
set_cursor_if_necessary(bd->CurrentCursor, emscripten_browser_cursor_internal::cursor::none);
return;
}
if (io.WantCaptureMouse) // mouse is hovering over the gui
{
if (bd->CursorToRestore == nullptr)