Skip to content

Child window popup with multi-viewport enabled does not respond to clicks under certain condition #3734

@zhicheng1458

Description

@zhicheng1458

Version/Branch of Dear ImGui:

Version: v1.80 WIP
Branch: Docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler: Microsoft Visual Studio
Operating System: Windows 10

My Issue/Question:

Child window popup with multi-viewport enabled does not respond to clicks when the following condition are met:

  1. Popup are not fully encapsulated within the glfw window where it is called upon.
  2. Clicks are made on the area of the popup that are within the glfw window.

Clicking on the popup outside of the glfw window has no issue. The behavior seems to replicate a unfocused child window that gets drawn on top of the glfw window where it is called upon.

Screenshots/Video

bandicam.2021-01-20.00-38-43-010.mp4
bandicam.2021-01-19.18-19-35-211.mp4

Standalone, minimal, complete and verifiable example:
Paste the following into the demo's main.cpp

            ImGuiViewport* main_viewport = ImGui::GetMainViewport();
            //Set the next window near the bottom left corner of the application, but without going out of bound
            ImGui::SetNextWindowSize(ImVec2(300.0f, 50.0f), ImGuiCond_Once);
            ImGui::SetNextWindowPos(ImVec2(main_viewport->GetWorkPos().x + 5.0f, main_viewport->GetWorkPos().y + main_viewport->GetWorkSize().y - 150.0f), ImGuiCond_Once);
            ImGui::Begin("Test");
            ImGui::ColorEdit4("##color", (float*)&style.Colors[0]);
            ImGui::End();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions