Skip to content

Duplicate controls appearing in popup modal in latest version of cimgui-go wrapper. #7405

@damntourists

Description

@damntourists

Version/Branch of Dear ImGui:

v1.90.4

Back-ends:

custom backend https://github.com/damntourists/cimgui-go-ebiten

Compiler, OS:

ubuntu

Full config/build information:

No response

Details:

My Issue/Question:
Hi Omar!

I've been debugging a strange issue with modal popups and I'm not sure if this has something to do with the cimgui, or cimgui-go wrappers at https://github.com/cimgui/cimgui && https://github.com/AllenDang/cimgui-go that may be causing it and was curious if you've seen anything like this in the imgui project?

My issue is that all controls defined inside of a popup are being duplicated. I'm using a custom backend for cimgui-go at https://github.com/damntourists/cimgui-go-ebiten which is still heavily a work in progress, but I can't seem to track down where this issue is coming from within the wrappers/backend. Curious if this could be an imgui thing? Perhaps the cimgui project needs to rebuild with the latest commits of imgui? I see the commit we're using of imgui is https://github.com/ocornut/imgui/tree/c6aa051629753f0ef0d26bf775a8b6a92aa213b2.

Any insight you may have would be greatly appreciated.

Screenshots/Video:

modal_contents_duplication

Minimal, Complete and Verifiable Example code:

func MakeProjectManagerWindow() {
	modalFlags := imgui.WindowFlagsNone |
		imgui.WindowFlagsNoResize |
		imgui.WindowFlagsAlwaysAutoResize

	var inputName string

	imgui.BeginV(ProjectManagerWindow.FullTitle(), &ProjectManagerWindow.open,
		ProjectManagerWindow.flags.combined())

	imgui.OpenPopupStr(pm.AddSceneModalTitle) // force it open for now to debug issue

	if imgui.BeginPopupModalV(pm.AddSceneModalTitle, nil, imgui.WindowFlags(modalFlags)) {
		imgui.SetKeyboardFocusHere()

		imgui.Text("hello")

		if imgui.InputTextWithHint("##AddSceneNameInput", "Name", &inputName,
			imgui.InputTextFlagsEnterReturnsTrue, nil) {
			scene_orm.CreateScene(inputName, pm.CurrentProject.ID(), pm.CurrentProject.ID())
			pm.CurrentProject.FetchScenes()
			imgui.CloseCurrentPopup()
		}

		//imgui.ShowDemoWindow()
		imgui.InternalDebugDrawCursorPos()
		imgui.InternalDebugDrawItemRect()
		imgui.InternalDebugLocateItemResolveWithLastItem()
		imgui.EndPopup()
	}

	imgui.BeginChildIDV(imgui.IDStr("projectmanger-view"),
		imgui.ContentRegionAvail(), imgui.ChildFlagsBorder,
		imgui.WindowFlagsNone)

	//ExpandSelection(projectmanger.CurrentProject.ID())

	imgui.EndChild()

	if imgui.BeginPopupContextItemV("pm-context", imgui.MouseButtonRight) {
		if imgui.SelectableBool("add scene") {
			imgui.OpenPopupStr(pm.AddSceneModalTitle)
		}
		if imgui.SelectableBool("add entity") {
			// add entity
		}
		imgui.EndPopup()
	}
	imgui.End()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions