mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-22 11:57:00 +00:00
Menus, Popups: Experimental fix for issue where clicking on an open BeginMenu() item called from a window which is neither a popup neither a menu used to incorrectly close and reopen the menu. (#5775)
This works by moving the ClosePopupsOverWindow() in FocusWindow() in the if() block which luckily solves our problem. In our test suite I couldn't find situation where this had side-effect others than BeginMenu() using the 'menuset_is_open' trick. It's difficult to tell if other side-effects are possible: a window being already focused should mean it doesn't have popups overit. Effectively this means that clicking e.g. on the BeginMenu() item to close a menu in a menu-bar now relies on BeginMenu() logic for the closure rather than FocusWindow() triggerd by button behavior.
This commit is contained in:
parent
81176737f8
commit
08752b372e
@ -145,6 +145,9 @@ Other Changes:
|
|||||||
- Menus: Fixed gaps in closing logic which would make child-menu erroneously close when crossing
|
- Menus: Fixed gaps in closing logic which would make child-menu erroneously close when crossing
|
||||||
the gap between a menu item inside a window and a child-menu in a secondary viewport. (#5614)
|
the gap between a menu item inside a window and a child-menu in a secondary viewport. (#5614)
|
||||||
- Menus: Fixed using IsItemHovered()/IsItemClicked() on BeginMenu(). (#5775)
|
- Menus: Fixed using IsItemHovered()/IsItemClicked() on BeginMenu(). (#5775)
|
||||||
|
- Menus, Popups: Experimental fix for issue where clicking on an open BeginMenu() item called from
|
||||||
|
a window which is neither a popup neither a menu used to incorrectly close and reopen the menu.
|
||||||
|
(the fix may have side-effect so labelld as experimental as we may need to revert) (#5775)
|
||||||
- Menus, Nav: Fixed keyboard/gamepad navigation occasionally erroneously landing on menu-item
|
- Menus, Nav: Fixed keyboard/gamepad navigation occasionally erroneously landing on menu-item
|
||||||
in parent window when the parent is not a popup. (#5730)
|
in parent window when the parent is not a popup. (#5730)
|
||||||
- Menus, Nav: Fixed not being able to close a menu with Left arrow when parent is not a popup. (#5730)
|
- Menus, Nav: Fixed not being able to close a menu with Left arrow when parent is not a popup. (#5730)
|
||||||
|
@ -7025,10 +7025,10 @@ void ImGui::FocusWindow(ImGuiWindow* window)
|
|||||||
g.NavLayer = ImGuiNavLayer_Main;
|
g.NavLayer = ImGuiNavLayer_Main;
|
||||||
g.NavFocusScopeId = 0;
|
g.NavFocusScopeId = 0;
|
||||||
g.NavIdIsAlive = false;
|
g.NavIdIsAlive = false;
|
||||||
}
|
|
||||||
|
|
||||||
// Close popups if any
|
// Close popups if any
|
||||||
ClosePopupsOverWindow(window, false);
|
ClosePopupsOverWindow(window, false);
|
||||||
|
}
|
||||||
|
|
||||||
// Move the root window to the top of the pile
|
// Move the root window to the top of the pile
|
||||||
IM_ASSERT(window == NULL || window->RootWindow != NULL);
|
IM_ASSERT(window == NULL || window->RootWindow != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user