Open s-pravin opened 3 years ago
There are two things at play here:
After Begin() the window has a clip rectangle to cover only the scrollable client area, and interactions are affected by this clipping rectangle. You may need to manually call PushClipRect()/PopClipRect() to temporarily access to the whole area outside the window client area.
May or not affect you: by default Hovering tests are performed on a "first come first served" (~back to front) basis, so when two items are overlapping the first one will get the Hover and generally be able to interact. Using SetItemAllowOverlap()
we have a (currently ill-defined and bit messy) mechanism to allow "last come first served" (~front to back) hovering tests. There are various treacherous aspect to the current implementation which I won't get into detail right now, but SetItemAllowOverlap()
is not always sufficient currently.
The reason I say this may not affect you is that the Title Bar actually doesn't submit a regular item, and therefore I think may not be affected by this requirement anyway.
Version/Branch of Dear ImGui:
Version: 1.81 Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp Operating System: Windows 10
My Issue/Question:
I am trying to customize ImGui window title bar by adding a custom button over it. Though, button content gets rendered as per expectation, button click isn't captured. I have set cursor position to the button location before invoking ItemSize, but am not confident if that's the correct way to achieve this.
Standalone, minimal, complete and verifiable example: