From 0941bd0fe52e2baa193b728339c9b879e249ec2c Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 3 Aug 2021 20:45:11 -0400 Subject: [PATCH] [client] imgui: move cursor change to after rendering overlays This allows it to take into the overlays into consideration when deciding which cursor is to be shown. --- client/src/app.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/app.c b/client/src/app.c index d6a4bd17..1e4f5426 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -771,13 +771,6 @@ int app_renderOverlay(struct Rect * rects, int maxRects) // bool test; // igShowDemoWindow(&test); - - ImGuiMouseCursor cursor = igGetMouseCursor(); - if (cursor != g_state.cursorLast) - { - g_state.ds->setPointer(mapImGuiCursor(cursor)); - g_state.cursorLast = cursor; - } } // render the overlays @@ -822,6 +815,16 @@ int app_renderOverlay(struct Rect * rects, int maxRects) overlay->lastRectCount = written; } + if (g_state.overlayInput) + { + ImGuiMouseCursor cursor = igGetMouseCursor(); + if (cursor != g_state.cursorLast) + { + g_state.ds->setPointer(mapImGuiCursor(cursor)); + g_state.cursorLast = cursor; + } + } + igRender(); return totalDamage ? -1 : totalRects;