As it turns out, functions like IsItemHovered() won't work on an open BeginMenu() because LastItemData is overriden by BeginPopup(). Probably an easy fix.
IM_ASSERT((flags&(ImGuiHoveredFlags_AnyWindow|ImGuiHoveredFlags_RootWindow|ImGuiHoveredFlags_ChildWindows|ImGuiHoveredFlags_NoPopupHierarchy))==0);// Flags not supported by this function
IM_ASSERT((flags&(ImGuiHoveredFlags_AnyWindow|ImGuiHoveredFlags_RootWindow|ImGuiHoveredFlags_ChildWindows|ImGuiHoveredFlags_NoPopupHierarchy))==0);// Flags not supported by this function
// Done with rectangle culling so we can perform heavier checks now
// Test if we are hovering the right window (our window could be behind another window)
// Test if we are hovering the right window (our window could be behind another window)
// [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851)
// [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851)
// [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable
// [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable
// Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
// Flags used by upcoming items
// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags.
// - output: stored in g.LastItemData.InFlags
// Current window shared by all windows.
// This is going to be exposed in imgui.h when stabilized enough.
// This is going to be exposed in imgui.h when stabilized enough.
enumImGuiItemFlags_
enumImGuiItemFlags_
{
{
@ -774,10 +777,11 @@ enum ImGuiItemFlags_
ImGuiItemFlags_ReadOnly=1<<7,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
ImGuiItemFlags_ReadOnly=1<<7,// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
// Controlled by widget code
// Controlled by widget code
ImGuiItemFlags_Inputable=1<<8,// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
ImGuiItemFlags_Inputable=1<<10,// false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
SetNextWindowPos(popup_pos,ImGuiCond_Always);// Note: this is super misleading! The value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
// FIXME: This technically breaks functions relying on LastItemData, somehow nobody complained yet. Should backup/restore LastItemData.
SetNextWindowPos(popup_pos,ImGuiCond_Always);// Note: misleading: the value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
PushStyleVar(ImGuiStyleVar_ChildRounding,style.PopupRounding);// First level will use _PopupRounding, subsequent will use _ChildRounding
PushStyleVar(ImGuiStyleVar_ChildRounding,style.PopupRounding);// First level will use _PopupRounding, subsequent will use _ChildRounding
menu_is_open=BeginPopupEx(id,flags);// menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
menu_is_open=BeginPopupEx(id,flags);// menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)