@ -7187,7 +7187,7 @@ static bool ImGui::GetWindowAlwaysWantOwnViewport(ImGuiWindow* window)
static bool ImGui : : UpdateTryMergeWindowIntoHostViewport ( ImGuiWindow * window , ImGuiViewportP * viewport )
{
ImGuiContext & g = * GImGui ;
if ( ! ( viewport - > Flags & ImGuiViewportFlags_CanHostOtherWindows ) | | window - > Viewport = = viewport | | viewport - > Platform Is Minimized)
if ( ! ( viewport - > Flags & ImGuiViewportFlags_CanHostOtherWindows ) | | window - > Viewport = = viewport | | viewport - > Platform Window Minimized)
return false ;
if ( ! viewport - > GetRect ( ) . Contains ( window - > Rect ( ) ) )
return false ;
@ -7242,7 +7242,7 @@ static ImGuiViewportP* FindViewportHoveredFromPlatformWindowStack(const ImVec2 m
for ( int n = 0 ; n < g . Viewports . Size ; n + + )
{
ImGuiViewportP * viewport = g . Viewports [ n ] ;
if ( ! ( viewport - > Flags & ImGuiViewportFlags_NoInputs ) & & ! viewport - > Platform Is Minimized & & viewport - > GetRect ( ) . Contains ( mouse_platform_pos ) )
if ( ! ( viewport - > Flags & ImGuiViewportFlags_NoInputs ) & & ! viewport - > Platform Window Minimized & & viewport - > GetRect ( ) . Contains ( mouse_platform_pos ) )
if ( best_candidate = = NULL | | best_candidate - > LastFrontMostStampCount < viewport - > LastFrontMostStampCount )
best_candidate = viewport ;
}
@ -7294,12 +7294,12 @@ static void ImGui::UpdateViewports()
if ( ( g . ConfigFlagsForFrame & ImGuiConfigFlags_ViewportsEnable ) )
{
if ( g . PlatformIO . Platform_GetWindowMinimized & & ( n = = 0 | | viewport - > Created PlatformWindow) )
viewport - > Platform Is Minimized = g . PlatformIO . Platform_GetWindowMinimized ( viewport ) ;
if ( g . PlatformIO . Platform_GetWindowMinimized & & ( n = = 0 | | viewport - > PlatformWindowCreated ) )
viewport - > Platform Window Minimized = g . PlatformIO . Platform_GetWindowMinimized ( viewport ) ;
// Apply Position and Size (from Platform Window to ImGui) if requested.
// We do it early in the frame instead of waiting for UpdatePlatformWindows() to avoid a frame of lag when moving/resizing using OS facilities.
if ( ! viewport - > Platform Is Minimized)
if ( ! viewport - > Platform Window Minimized)
{
if ( viewport - > PlatformRequestMove )
viewport - > Pos = viewport - > LastPlatformPos = g . PlatformIO . Platform_GetWindowPos ( viewport ) ;
@ -7387,14 +7387,14 @@ static void ImGui::UpdateViewports()
const bool is_mouse_dragging_with_an_expected_destination = g . DragDropActive ;
if ( is_mouse_dragging_with_an_expected_destination & & viewport_hovered = = NULL )
viewport_hovered = g . MouseLastHoveredViewport ;
if ( is_mouse_dragging_with_an_expected_destination | | g . ActiveId = = 0 | | ! I mGui: : I sAnyMouseDown( ) )
if ( is_mouse_dragging_with_an_expected_destination | | g . ActiveId = = 0 | | ! I sAnyMouseDown( ) )
if ( viewport_hovered ! = NULL & & viewport_hovered ! = g . MouseViewport & & ! ( viewport_hovered - > Flags & ImGuiViewportFlags_NoInputs ) )
g . MouseViewport = viewport_hovered ;
IM_ASSERT ( g . MouseViewport ! = NULL ) ;
}
// FIXME: We should ideally refactor the system to call this every frame (we currently don't)
// FIXME: We should ideally refactor the system to call this every frame (we currently don't)
ImGuiViewportP * ImGui : : AddUpdateViewport ( ImGuiWindow * window , ImGuiID id , const ImVec2 & pos , const ImVec2 & size , ImGuiViewportFlags flags )
{
ImGuiContext & g = * GImGui ;
@ -7601,7 +7601,7 @@ void ImGui::UpdatePlatformWindows()
}
// Create window
bool is_new_window = ( viewport - > Created PlatformWindow = = false ) ;
bool is_new_window = ( viewport - > PlatformWindowCreated = = false ) ;
if ( is_new_window )
{
g . PlatformIO . Platform_CreateWindow ( viewport ) ;
@ -7610,7 +7610,7 @@ void ImGui::UpdatePlatformWindows()
viewport - > LastNameHash = 0 ;
viewport - > LastPlatformPos = viewport - > LastPlatformSize = ImVec2 ( FLT_MAX , FLT_MAX ) ; // By clearing those we'll enforce a call to Platform_SetWindowPos/Platform_SetWindowSize before Platform_ShowWindow
viewport - > LastRendererSize = viewport - > Size ;
viewport - > Created PlatformWindow = true ;
viewport - > PlatformWindowCreated = true ;
}
// Apply Position and Size (from ImGui to Platform/Renderer back-ends)
@ -7757,7 +7757,7 @@ void ImGui::DestroyPlatformWindow(ImGuiViewportP* viewport)
IM_ASSERT ( viewport - > PlatformUserData = = NULL ) ;
viewport - > PlatformHandle = NULL ;
viewport - > RendererUserData = viewport - > PlatformHandle = NULL ;
viewport - > Created PlatformWindow = false ;
viewport - > PlatformWindowCreated = false ;
}
void ImGui : : DestroyPlatformWindows ( )
@ -9897,7 +9897,7 @@ static void RenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewp
ImVec2 scale = bb . GetSize ( ) / viewport - > Size ;
ImVec2 off = bb . Min - viewport - > Pos * scale ;
float alpha_mul = viewport - > Platform Is Minimized ? 0.30f : 1.00f ;
float alpha_mul = viewport - > Platform Window Minimized ? 0.30f : 1.00f ;
window - > DrawList - > AddRectFilled ( bb . Min , bb . Max , ImGui : : GetColorU32 ( ImGuiCol_Border , alpha_mul * 0.40f ) ) ;
for ( int i = 0 ; i ! = g . Windows . Size ; i + + )
{
@ -10104,7 +10104,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGui : : BulletText ( " Flags: 0x%04X =%s%s%s%s%s%s " , viewport - > Flags ,
( flags & ImGuiViewportFlags_CanHostOtherWindows ) ? " CanHostOtherWindows " : " " , ( flags & ImGuiViewportFlags_NoDecoration ) ? " NoDecoration " : " " ,
( flags & ImGuiViewportFlags_NoFocusOnAppearing ) ? " NoFocusOnAppearing " : " " , ( flags & ImGuiViewportFlags_NoInputs ) ? " NoInputs " : " " ,
( flags & ImGuiViewportFlags_NoRendererClear ) ? " NoRendererClear " : " " , viewport - > Platform IsMinimized ? " , PlatformIs Minimized" : " " ) ;
( flags & ImGuiViewportFlags_NoRendererClear ) ? " NoRendererClear " : " " , viewport - > Platform WindowMinimized ? " , PlatformWindow Minimized" : " " ) ;
for ( int layer_i = 0 ; layer_i < IM_ARRAYSIZE ( viewport - > DrawDataBuilder . Layers ) ; layer_i + + )
for ( int draw_list_i = 0 ; draw_list_i < viewport - > DrawDataBuilder . Layers [ layer_i ] . Size ; draw_list_i + + )
Funcs : : NodeDrawList ( NULL , viewport , viewport - > DrawDataBuilder . Layers [ layer_i ] [ draw_list_i ] , " DrawList " ) ;