From b452984bca56bceb9821a6c90f47efd5888fa06f Mon Sep 17 00:00:00 2001 From: SlowRiot Date: Thu, 2 Apr 2026 23:03:29 +0100 Subject: [PATCH] hide the browser cursor if imgui is handling software cursor rendering --- backends/imgui_impl_emscripten.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backends/imgui_impl_emscripten.cpp b/backends/imgui_impl_emscripten.cpp index 837131841..df8f9047a 100644 --- a/backends/imgui_impl_emscripten.cpp +++ b/backends/imgui_impl_emscripten.cpp @@ -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)