Coder Social home page Coder Social logo

Comments (3)

ocornut avatar ocornut commented on September 17, 2024

Thanks for reporting. I have pushed a fix for the first issue.
I don't yet know how to solve the second one.

from imgui.

ocornut avatar ocornut commented on September 17, 2024

I have also pushed a fix for the second use case: 6864a7f

However, that popup case may be generalized further, even without popup:

ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags_RefreshOnFocus | ImGuiWindowRefreshFlags_RefreshOnHover | ImGuiWindowRefreshFlags_TryToAvoidRefresh);
if (ImGui::Begin("Window A"))
{
    ImGui::Text("%d", ImGui::GetFrameCount());

    ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags_RefreshOnFocus | 
ImGuiWindowRefreshFlags_RefreshOnHover | ImGuiWindowRefreshFlags_TryToAvoidRefresh);
    if (ImGui::Begin("Window B"))
    {
        ImGui::Text("%d", ImGui::GetFrameCount());
    }
    ImGui::End();
}
ImGui::End();

And this gets more tricky because whereas in the popup case, the nested popup can't exist when parent is focused, here they are two distinct windows. We would need to store an array of windows submitted within our begin stack next to window->DC.ChildWindows[], solely for use of marking them active with skiprefresh, which itself would be inconsistent with expected behavior. So, I don't know.

from imgui.

VerySmallRoach avatar VerySmallRoach commented on September 17, 2024

At the very least case with Begin, unlike BeginChild/popup, could be solved by user by moving Begin call outside and manually controlling Window B visibility. Still a booby trap, but a booby trap that can be worked around.
Don't really know what else to say, I'm not that familiar with ImGui to discuss edge cases that I've never encountered myself, let alone solutions to them. I'll leave to your discretion whenever to close this issue or keep it open.

from imgui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.