Is there an idiomatic way to achieve what IsWindowAppearing() does for non-window "appearables"? #9581

Open
opened 2026-10-12 17:59:18 +00:00 by sodamouse · 3 comments
sodamouse commented 2026-10-12 17:59:18 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version 1.92.9b, Branch: Docking

Back-ends:

imgui_impl_dx12.cpp + imgui_impl_win32.cpp

Compiler, OS:

Windows 11 + MSVC 2022

Full config/build information:

N/A.

Details

Currently, I use the following hack to know if a tab, child window that is obscured on first frame, etc. has just appeared:

if (ImGui::BeginTabItem("Some tab"))
{
    s32 frame_drawn = -1;

    if (ImGui::GetFrameCount() > frame_drawn + 1)
    {
        // Tab has just appeared for the first time.
    }

    frame_drawn = ImGui::GetFrameCount();

    ImGui::EndTabItem();
}

Issue / question:

I am wondering if there is a better, more idiomatic way that I might be missing.

### Version/Branch of Dear ImGui: Version 1.92.9b, Branch: Docking ### Back-ends: imgui_impl_dx12.cpp + imgui_impl_win32.cpp ### Compiler, OS: Windows 11 + MSVC 2022 ### Full config/build information: N/A. ### Details Currently, I use the following hack to know if a tab, child window that is obscured on first frame, etc. has just appeared: ```c++ if (ImGui::BeginTabItem("Some tab")) { s32 frame_drawn = -1; if (ImGui::GetFrameCount() > frame_drawn + 1) { // Tab has just appeared for the first time. } frame_drawn = ImGui::GetFrameCount(); ImGui::EndTabItem(); } ``` ### Issue / question: I am wondering if there is a better, more idiomatic way that I might be missing.
ocornut commented 2026-10-12 21:18:10 +00:00 (Migrated from github.com)

If you specifically mean for Tabs we could potentially add some sort of information in imgui_internal.h.
Your sentence mention both "Tabs" and "Child" so it's confusing.
If you mean more generically speaking, it's not really possible.

If you specifically mean for Tabs we could potentially add some sort of information in imgui_internal.h. Your sentence mention both "Tabs" and "Child" so it's confusing. If you mean more generically speaking, it's not really possible.
ocornut commented 2026-10-12 21:18:10 +00:00 (Migrated from github.com)

If you specifically mean for Tabs we could potentially add some sort of information in imgui_internal.h.
Your sentence mention both "Tabs" and "Child" so it's confusing.
If you mean more generically speaking, it's not really possible.

If you specifically mean for Tabs we could potentially add some sort of information in imgui_internal.h. Your sentence mention both "Tabs" and "Child" so it's confusing. If you mean more generically speaking, it's not really possible.
sodamouse commented 2026-10-18 06:27:34 +00:00 (Migrated from github.com)

I use the same approach with BeginChild to know if a child window has just appeared.

I use the same approach with `BeginChild` to know if a child window has just appeared.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#9581
No description provided.