@ -3918,16 +3918,10 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
else
else
PushClipRect ( fullscreen_rect . Min , fullscreen_rect . Max , true ) ;
PushClipRect ( fullscreen_rect . Min , fullscreen_rect . Max , true ) ;
// New windows appears in front
if ( ! window_was_active )
if ( ! window_was_active )
{
{
window - > AutoPosLastDirection = - 1 ;
if ( ! ( flags & ImGuiWindowFlags_NoFocusOnAppearing ) )
if ( ! ( flags & ( ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip ) ) | | ( flags & ImGuiWindowFlags_Popup ) )
FocusWindow ( window ) ;
// Popup first latch mouse position, will position itself when it appears next frame
// Popup first latch mouse position, will position itself when it appears next frame
window - > AutoPosLastDirection = - 1 ;
if ( ( flags & ImGuiWindowFlags_Popup ) ! = 0 & & ! window_pos_set_by_api )
if ( ( flags & ImGuiWindowFlags_Popup ) ! = 0 & & ! window_pos_set_by_api )
window - > PosFloat = g . IO . MousePos ;
window - > PosFloat = g . IO . MousePos ;
}
}
@ -4265,6 +4259,11 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if ( window - > AutoFitFramesY > 0 )
if ( window - > AutoFitFramesY > 0 )
window - > AutoFitFramesY - - ;
window - > AutoFitFramesY - - ;
// New windows appears in front (we need to do that AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there)
if ( ! window_was_active & & ! ( flags & ImGuiWindowFlags_NoFocusOnAppearing ) )
if ( ! ( flags & ( ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Tooltip ) ) | | ( flags & ImGuiWindowFlags_Popup ) )
FocusWindow ( window ) ;
// Title bar
// Title bar
if ( ! ( flags & ImGuiWindowFlags_NoTitleBar ) )
if ( ! ( flags & ImGuiWindowFlags_NoTitleBar ) )
{
{