@ -1527,7 +1527,7 @@ ImGuiWindow::ImGuiWindow(const char* name)
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = ImGuiSetCond_Always | ImGuiSetCond_Once | ImGuiSetCond_FirstUseEver | ImGuiSetCond_Appearing ;
SetWindowPosCenterWanted = false ;
LastFrameDrawn = - 1 ;
LastFrameActive = - 1 ;
ItemWidthDefault = 0.0f ;
FontWindowScale = 1.0f ;
@ -3498,7 +3498,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
const int current_frame = ImGui : : GetFrameCount ( ) ;
const bool first_begin_of_the_frame = ( window - > LastFrameDrawn ! = current_frame ) ;
const bool first_begin_of_the_frame = ( window - > LastFrameActive ! = current_frame ) ;
if ( first_begin_of_the_frame )
window - > Flags = ( ImGuiWindowFlags ) flags ;
else
@ -3511,12 +3511,12 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
CheckStacksSize ( window , true ) ;
IM_ASSERT ( parent_window ! = NULL | | ! ( flags & ImGuiWindowFlags_ChildWindow ) ) ;
bool window_was_visibl e = ( window - > LastFrameDrawn = = current_frame - 1 ) ; // Not using !WasActive because the implicit "Debug" window would always toggle off->on
bool window_was_activ e = ( window - > LastFrameActive = = current_frame - 1 ) ; // Not using !WasActive because the implicit "Debug" window would always toggle off->on
if ( flags & ImGuiWindowFlags_Popup )
{
ImGuiPopupRef & popup_ref = g . OpenedPopupStack [ g . CurrentPopupStack . Size ] ;
window_was_visibl e & = ( window - > PopupID = = popup_ref . PopupID ) ;
window_was_visibl e & = ( window = = popup_ref . Window ) ;
window_was_activ e & = ( window - > PopupID = = popup_ref . PopupID ) ;
window_was_activ e & = ( window = = popup_ref . Window ) ;
popup_ref . Window = window ;
g . CurrentPopupStack . push_back ( popup_ref ) ;
window - > PopupID = popup_ref . PopupID ;
@ -3527,7 +3527,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
if ( g . SetNextWindowPosCond )
{
const ImVec2 backup_cursor_pos = window - > DC . CursorPos ; // FIXME: not sure of the exact reason of this anymore :( need to look into that.
if ( ! window_was_visibl e ) window - > SetWindowPosAllowFlags | = ImGuiSetCond_Appearing ;
if ( ! window_was_activ e ) window - > SetWindowPosAllowFlags | = ImGuiSetCond_Appearing ;
window_pos_set_by_api = ( window - > SetWindowPosAllowFlags & g . SetNextWindowPosCond ) ! = 0 ;
if ( window_pos_set_by_api & & ImLengthSqr ( g . SetNextWindowPosVal - ImVec2 ( - FLT_MAX , - FLT_MAX ) ) < 0.001f )
{
@ -3543,7 +3543,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
if ( g . SetNextWindowSizeCond )
{
if ( ! window_was_visibl e ) window - > SetWindowSizeAllowFlags | = ImGuiSetCond_Appearing ;
if ( ! window_was_activ e ) window - > SetWindowSizeAllowFlags | = ImGuiSetCond_Appearing ;
window_size_set_by_api = ( window - > SetWindowSizeAllowFlags & g . SetNextWindowSizeCond ) ! = 0 ;
ImGui : : SetWindowSize ( g . SetNextWindowSizeVal , g . SetNextWindowSizeCond ) ;
g . SetNextWindowSizeCond = 0 ;
@ -3559,7 +3559,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
}
if ( g . SetNextWindowCollapsedCond )
{
if ( ! window_was_visibl e ) window - > SetWindowCollapsedAllowFlags | = ImGuiSetCond_Appearing ;
if ( ! window_was_activ e ) window - > SetWindowCollapsedAllowFlags | = ImGuiSetCond_Appearing ;
ImGui : : SetWindowCollapsed ( g . SetNextWindowCollapsedVal , g . SetNextWindowCollapsedCond ) ;
g . SetNextWindowCollapsedCond = 0 ;
}
@ -3591,7 +3591,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window - > BeginCount = 0 ;
window - > DrawList - > Clear ( ) ;
window - > ClipRect = ImVec4 ( - FLT_MAX , - FLT_MAX , + FLT_MAX , + FLT_MAX ) ;
window - > LastFrameDrawn = current_frame ;
window - > LastFrameActive = current_frame ;
window - > IDStack . resize ( 1 ) ;
// Setup texture, outer clipping rectangle
@ -3602,7 +3602,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
PushClipRect ( GetVisibleRect ( ) ) ;
// New windows appears in front
if ( ! window_was_visibl e )
if ( ! window_was_activ e )
{
window - > AutoPosLastDirection = - 1 ;
@ -3644,7 +3644,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window - > SizeContents . y = ( window - > SizeContentsExplicit . y ! = 0.0f ) ? window - > SizeContentsExplicit . y : ( ( window_is_new ? 0.0f : window - > DC . CursorMaxPos . y - window - > Pos . y ) + window - > Scroll . y ) ;
// Hide popup/tooltip window when first appearing while we measure size (because we recycle them)
if ( ( flags & ( ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip ) ) ! = 0 & & ! window_was_visibl e )
if ( ( flags & ( ImGuiWindowFlags_Popup | ImGuiWindowFlags_Tooltip ) ) ! = 0 & & ! window_was_activ e )
{
window - > HiddenFrames = 1 ;
if ( flags & ImGuiWindowFlags_AlwaysAutoResize )
@ -3964,7 +3964,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window - > DC . TreeDepth = 0 ;
window - > DC . StateStorage = & window - > StateStorage ;
window - > DC . GroupStack . resize ( 0 ) ;
window - > MenuColumns . Update ( 3 , style . ItemSpacing . x , ! window_was_visibl e ) ;
window - > MenuColumns . Update ( 3 , style . ItemSpacing . x , ! window_was_activ e ) ;
if ( window - > AutoFitFramesX > 0 )
window - > AutoFitFramesX - - ;