From eefae082617cd36d9b1d412e481a7913ab0ef3f2 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 14 Jul 2020 18:36:35 +0200 Subject: [PATCH] Nav: Fixed clicking on void from not clearing focused window. Amend d31fe97f7. (#3344, #2880) This would be problematic e.g. in situation where the application relies on io.WantCaptureKeyboard flag being cleared accordingly. --- docs/CHANGELOG.txt | 5 ++++- imgui.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 0264e3147..b11ed1929 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -37,6 +37,9 @@ HOW TO UPDATE? Other Changes: +- Nav: Fixed clicking on void from not clearing focused window. + This would be problematic e.g. in situation where the application relies on io.WantCaptureKeyboard + flag being cleared accordingly. (bug introduced in 1.77 WIP on 2020/06/16) (#3344, #2880) - InputText, ImDrawList: Fixed assert triggering when drawing single line of text with more than ~16 KB characters. (Note that current code is going to show corrupted display if after clipping, more than 16 KB characters are visible in the same low-level ImDrawList::RenderText @@ -62,7 +65,7 @@ Decorated log: https://github.com/ocornut/imgui/releases/tag/v1.77 Breaking Changes: - Removed unnecessary ID (first arg) of ImFontAtlas::AddCustomRectRegular() function. Please - note that this is a Beta api and will likely be reworked in order to support multi-DPI accross + note that this is a Beta api and will likely be reworked in order to support multi-DPI across multiple monitors. - Renamed OpenPopupOnItemClick() to OpenPopupContextItem(). Kept inline redirection function (will obsolete). - Removed BeginPopupContextWindow(const char*, int mouse_button, bool also_over_items) in favor diff --git a/imgui.cpp b/imgui.cpp index 37e611adb..b17e2ee87 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3367,7 +3367,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame() if (!root_window->TitleBarRect().Contains(g.IO.MouseClickedPos[0])) g.MovingWindow = NULL; } - else if (root_window != NULL && g.NavWindow != NULL && GetTopMostPopupModal() == NULL) + else if (root_window == NULL && g.NavWindow != NULL && GetTopMostPopupModal() == NULL) { // Clicking on void disable focus FocusWindow(NULL);