From 8e48ab6b19d153c2ff9b56379ff1fb60034ca133 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 7 Jun 2018 18:08:59 +0200 Subject: [PATCH] Nav: Addendum: only set io.WantSetMousePos if necessary. (#1867) --- imgui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 44d09852..125c1a5f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3262,8 +3262,11 @@ static void ImGui::NavUpdate() // Set mouse position given our knowledge of the navigated item position from last frame if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (g.IO.BackendFlags & ImGuiBackendFlags_HasSetMousePos)) { - g.IO.MousePos = g.IO.MousePosPrev = NavCalcPreferredRefPos(); - g.IO.WantSetMousePos = true; + if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow) + { + g.IO.MousePos = g.IO.MousePosPrev = NavCalcPreferredRefPos(); + g.IO.WantSetMousePos = true; + } } g.NavMousePosDirty = false; }