-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BeginPopupContextItem() fail to gain focus when it is called within a BeginChild() #4676
Comments
Hello, If I use your code it works. There is something you are omitting which may be interfering (which is why the issue guidelines ask for a verifiable minimum repro). PS: The ImGui::BeginChild("ChildR", ImVec2(500, 350), true, ImGuiWindowFlags_None);
bool bTreeNodeExpanded = ImGui::TreeNode("hello");
if (!bTreeNodeExpanded && ImGui::IsItemHovered())
ImGui::SetTooltip("Right-click to delete.\nDrag and draw to reorder.");
if (!bTreeNodeExpanded && ImGui::BeginPopupContextItem("Hello"))
{
if (ImGui::MenuItem("Delete"))
{
//ImGui::EndPopup();
}
ImGui::EndPopup();
}
if (bTreeNodeExpanded)
{
ImGui::Text("Hello");
ImGui::TreePop();
}
ImGui::EndChild(); |
Given the shading in your screenshot I noticed you may have an outer modal carrying the child window. |
Pushed a fix c363b6d |
…xed IsWindowFocused()/IsWindowHovered() issues with childs inside popups. (ocornut#4676)(ocornut#4676, ocornut#4527) Amend/fix 6b1e094f, fc4988f (Sep 24)
Version/Branch of Dear ImGui:
Version: 1.86 WIP (18502)
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler: Visual Studio 2019 (MSVC 1929) with C++20
Operating System: Windows 10
My Issue/Question:
When I place a BeginPopupContextItem() inside a Child window, the menu appears but my mouse cannot click on it. It wouldn't disappear or select a random item when I click, it just won't get focus, hover, or receive any click message.
The program is not frozen, if you click anywhere else, the pop-up menu will disappear like normal.
Item can still be 'selected' if I use my arrow key on the keyboard, but hitting Enter key gets no result.
I googled and searched many closed issues in this repo, but nothing similar pops out.
Searched in FAQ, nothing pops out.
Screenshots/Video
![2021-10-26](https://user-images.githubusercontent.com/33283030/138916445-efdafaae-cfe3-479f-803b-bf150849427d.png)
(Have no screen-recording software...)
(My mouse cursor is located exactly at the 'D' part of the "Delete" word in the following screenshot. Sorry that Windows snap cannot include the cursor.)
Standalone, minimal, complete and verifiable example:
Opened source repo.
Despite the name, it is a game modding tool, not a 'trainer' or something similar.
The code looks like this:
(If you were inspecting my repo, it's in CZeroEditor.cpp line 3000 (#pragma region CharacterTemplateModal))
[Edit Oct 27: Add a screenshot]
The text was updated successfully, but these errors were encountered: