@ -6073,6 +6073,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{
{
// Initialize
// Initialize
const bool window_is_child_tooltip = ( flags & ImGuiWindowFlags_ChildWindow ) & & ( flags & ImGuiWindowFlags_Tooltip ) ; // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345)
const bool window_is_child_tooltip = ( flags & ImGuiWindowFlags_ChildWindow ) & & ( flags & ImGuiWindowFlags_Tooltip ) ; // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345)
const bool window_just_appearing_after_hidden_for_resize = ( window - > HiddenFramesCannotSkipItems > 0 ) ;
window - > Active = true ;
window - > Active = true ;
window - > HasCloseButton = ( p_open ! = NULL ) ;
window - > HasCloseButton = ( p_open ! = NULL ) ;
window - > ClipRect = ImVec4 ( - FLT_MAX , - FLT_MAX , + FLT_MAX , + FLT_MAX ) ;
window - > ClipRect = ImVec4 ( - FLT_MAX , - FLT_MAX , + FLT_MAX , + FLT_MAX ) ;
@ -6234,6 +6235,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
SetWindowPos ( window , window - > SetWindowPosVal - window - > Size * window - > SetWindowPosPivot , 0 ) ; // Position given a pivot (e.g. for centering)
SetWindowPos ( window , window - > SetWindowPosVal - window - > Size * window - > SetWindowPosPivot , 0 ) ; // Position given a pivot (e.g. for centering)
else if ( ( flags & ImGuiWindowFlags_ChildMenu ) ! = 0 )
else if ( ( flags & ImGuiWindowFlags_ChildMenu ) ! = 0 )
window - > Pos = FindBestWindowPosForPopup ( window ) ;
window - > Pos = FindBestWindowPosForPopup ( window ) ;
else if ( ( flags & ImGuiWindowFlags_Popup ) ! = 0 & & ! window_pos_set_by_api & & window_just_appearing_after_hidden_for_resize )
window - > Pos = FindBestWindowPosForPopup ( window ) ;
else if ( ( flags & ImGuiWindowFlags_Tooltip ) ! = 0 & & ! window_pos_set_by_api & & ! window_is_child_tooltip )
else if ( ( flags & ImGuiWindowFlags_Tooltip ) ! = 0 & & ! window_pos_set_by_api & & ! window_is_child_tooltip )
window - > Pos = FindBestWindowPosForPopup ( window ) ;
window - > Pos = FindBestWindowPosForPopup ( window ) ;
@ -9417,6 +9420,10 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
r_avoid = ImRect ( parent_window - > Pos . x + horizontal_overlap , - FLT_MAX , parent_window - > Pos . x + parent_window - > Size . x - horizontal_overlap - parent_window - > ScrollbarSizes . x , FLT_MAX ) ;
r_avoid = ImRect ( parent_window - > Pos . x + horizontal_overlap , - FLT_MAX , parent_window - > Pos . x + parent_window - > Size . x - horizontal_overlap - parent_window - > ScrollbarSizes . x , FLT_MAX ) ;
return FindBestWindowPosForPopupEx ( window - > Pos , window - > Size , & window - > AutoPosLastDirection , r_outer , r_avoid , ImGuiPopupPositionPolicy_Default ) ;
return FindBestWindowPosForPopupEx ( window - > Pos , window - > Size , & window - > AutoPosLastDirection , r_outer , r_avoid , ImGuiPopupPositionPolicy_Default ) ;
}
}
if ( window - > Flags & ImGuiWindowFlags_Popup )
{
return FindBestWindowPosForPopupEx ( window - > Pos , window - > Size , & window - > AutoPosLastDirection , r_outer , ImRect ( window - > Pos , window - > Pos ) , ImGuiPopupPositionPolicy_Default ) ; // Ideally we'd disable r_avoid here
}
if ( window - > Flags & ImGuiWindowFlags_Tooltip )
if ( window - > Flags & ImGuiWindowFlags_Tooltip )
{
{
// Position tooltip (always follows mouse)
// Position tooltip (always follows mouse)