Skip to content

Commit

Permalink
Menus, Popups: Fixed an issue where sibling menu popups re-opening in…
Browse files Browse the repository at this point in the history
… successive frames would erroneously close the window. (ocornut#7325, ocornut#7287, ocornut#7063)

Amend 014e0ac
  • Loading branch information
ocornut committed Feb 27, 2024
1 parent 9877941 commit c3f8f4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ HOW TO UPDATE?

Other changes:

- Menus, Popups: Fixed an issue where sibling menu popups re-opening in successive
frames would erroneously close the window. While it is technically a popup issue
it would generally manifest when fast moving the mouse bottom to top in a sub-menu.
(#7325, #7287, #7063)


-----------------------------------------------------------------------
VERSION 1.90.4 (Released 2024-02-22)
Expand Down
3 changes: 2 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10887,7 +10887,8 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
ImGuiPopupData prev_popup = g.OpenPopupStack[remaining];
g.OpenPopupStack.resize(remaining);

if (restore_focus_to_window_under_popup)
// Restore focus (unless popup window was not yet submitted, and didn't have a chance to take focus anyhow. See #7325 for an edge case)
if (restore_focus_to_window_under_popup && prev_popup.Window)
{
ImGuiWindow* popup_window = prev_popup.Window;
ImGuiWindow* focus_window = (popup_window && popup_window->Flags & ImGuiWindowFlags_ChildMenu) ? popup_window->ParentWindow : prev_popup.RestoreNavWindow;
Expand Down
2 changes: 1 addition & 1 deletion imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.90.5 WIP"
#define IMGUI_VERSION_NUM 19041
#define IMGUI_VERSION_NUM 19042
#define IMGUI_HAS_TABLE

/*
Expand Down

0 comments on commit c3f8f4d

Please sign in to comment.