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

Creating a window after a modal popup causes an assert (1.86 release) #4920

Closed
ET3D-ET3D opened this issue Jan 20, 2022 · 2 comments
Closed

Comments

@ET3D-ET3D
Copy link

Here's a simple example:

		ImGui::OpenPopup("Popup");
		if (ImGui::BeginPopupModal("Popup", NULL, ImGuiWindowFlags_AlwaysAutoResize))
		{
			ImGui::Text("In popup");
			ImGui::EndPopup();
		}

		ImGui::Begin("Window");
		ImGui::Text("Test");
		ImGui::End();

This asserts in the Begin function of the window on "IM_ASSERT(blocking_modal != NULL);".

I fixed it locally by replacing the assert with

		if (blocking_modal == NULL)
			blocking_modal = modal;

I don't understand the code deeply enough to know if this is the best fix, but it seems to work well.

rokups added a commit to rokups/imgui that referenced this issue Jan 20, 2022
rokups added a commit to rokups/imgui that referenced this issue Jan 20, 2022
@ocornut
Copy link
Owner

ocornut commented Jan 20, 2022

Thank you @ET3D-ET3D for reporting.
@rokups looked at it and pushed a fix 19471da

(Also added a regression test for it)

@ocornut ocornut closed this as completed Jan 20, 2022
@ET3D-ET3D
Copy link
Author

Impressively quick response. Thanks.

wolfpld added a commit to wolfpld/tracy that referenced this issue Feb 3, 2022
eclbtownsend pushed a commit to Eclipsemining/imgui-fork that referenced this issue Feb 3, 2022
bcumming pushed a commit to bcumming/tracy that referenced this issue Feb 20, 2022
eclbtownsend pushed a commit to Eclipsemining/imgui-fork that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants