-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Assert in BeginDragDropSource when dragging window to bottom of screen #4515
Comments
Interesting, the issue is because the child window is entirely out of view ( The workaround/fix is to enclose your child contents submission under a As per specs we should fix it tho. |
The assert is misleading here: it is meant for the actual case of using items without ID as a drag source, e.g. a Fix coming soon. |
Pushed a fix now! Thanks for the report and careful repro (we'll be adding some regression tests based on it). A similar issue would manifest with either |
Thanks! BTW, do you think |
It already had that check in. |
Version/Branch of Dear ImGui:
Version: 1.84.1 (58f5092)
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: SDL/OpenGL3 (Modified the example_sdl_opengl3 example)
Operating System: MacOS
My Issue/Question:
I am getting this fatal assert:
Assertion failed: (0), function BeginDragDropSource, file ../../imgui.cpp, line 10561.
Steps:
a. Removed io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
b. Removed the existing gui (everything between
ImGui::NewFrame();
andImGui::Render();
)c. Added the below code and called it between
ImGui::NewFrame();
andImGui::Render();
I'm not trying to use multiple viewports/create a window outside the window (I disabled ImGuiConfigFlags_ViewportsEnable). It just happens that if you drag a floating window down there with the below code, it will fatal assert.
Screenshots/Video
Standalone, minimal, complete and verifiable example: (see #2261)
Other Notes
The comments around the assert are here. I read the comments and the code below it. My take from reading it was that as long as the widget has a unique ID, I should be fine. But I'm not certain I understand what's being said.
I also tried changing the button to:
But I was expecting by pushing the ID, that this would not be necessary. (But really not sure)
Adding the flag to the call (i.e.
ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)
) skips the assert, but I'm not sure what the downside of this is. I thought, especially with the change to sprintf a unique ID, that I would not need this.Paste from About ImGui
The text was updated successfully, but these errors were encountered: