Skip to content
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

Fix BeginPopupContextWindow() to behave correctly when bound to a child #1404

Closed
wants to merge 1 commit into from

Conversation

jstine35
Copy link

@jstine35 jstine35 commented Oct 30, 2017

I noticed while testing the Console sample in imgui-demo.cpp that the right-click context menu inside the child scroll-frame wouldn't show up sometimes (or most of the time, even). As best as I can determine, it would only work when no imgui window is active. Once any window is active -- even the parent/root of the child -- the right-click popup would no longer function.

@jstine35 jstine35 changed the title ix BeginPopupContextWindow() to behave in an expected fashion Fix BeginPopupContextWindow() to behave correctly when bound to a child Oct 30, 2017
@ocornut
Copy link
Owner

ocornut commented Nov 2, 2017

Thank you Jake, looking into it!
This was added in 695ea45 as part of #1382

Your patch fixes the console window (which has this problem because the text input field in the root window is force-activated at all time) but I think the issue is that we need to decide and clarify the default behavior of IsWindowHovered(). I added that test and support for the ImGuiHoveredFlags_AllowWhenBlockedByActiveItem flag primarily to be symmetrical with IsItemHovered() but looking into it now I am finding it hard to justify exactly how IsWindowHovered() should behave when there is an active item. My own codebase here doesn't use IsWindowHovered() very much.

Will look into it.
References, e.g. Lumix codebase:
https://github.com/nem0/LumixEngine/search?utf8=%E2%9C%93&q=IsWindowHovered&type=

ocornut added a commit that referenced this pull request Nov 2, 2017
ocornut added a commit that referenced this pull request Nov 2, 2017
…sRootWindowOrAnyChildHovered() obsolete in favor of IsWindowHovered( ImGuiHoveredFlags_FlattenChilds) (#1382, #1404)
@ocornut
Copy link
Owner

ocornut commented Nov 2, 2017

@jstine35 I have now pushed a fix for the issue, it's not your proposed PR as it follows logic that was already handled by IsItemHovered(), namely that we use the internal ActiveIdAllowOverlap flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants