ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Inputs not working outside of main viewport in docking branch.

Open pyboers opened this issue 2 years ago • 6 comments

In the docking branch, if the main veldrid window is out of focus, scrolling right click etc does not work in ImGui windows outside of the the viewport.

pyboers avatar Jul 05 '23 09:07 pyboers

I'll look into it, but it's not really a high priority since docking_branch is just a Demo/Proof-of-Concept.

zaafar avatar Jul 05 '23 18:07 zaafar

@pyboers I'm not familiar with Veldrid, however I am working with an event based windowing system that needs a similar controller setup as the Veldrid example. You have to wire up input event routing inside each of the created windows independently of the main window and send them through ImGui's IO event system. Keep in mind that when using viewports ImGui expects the input events to be in raw screen space coordinate, so you might have to do some coordinate conversions.

@zaafar as an aside, why hasn't the docking branch been pulled up yet? I'm pretty sure viewports and docking have been merged into imgui master by now. I don't think there's any reason it shouldn't be in ImGui.NET either in terms of "it's supported, you have to do the legwork to make it work for your use case".

desiwko avatar Jul 22 '23 02:07 desiwko

@zaafar as an aside, why hasn't the docking branch been pulled up yet? I'm pretty sure viewports and docking have been merged into imgui master by now. I don't think there's any reason it shouldn't be in ImGui.NET either in terms of "it's supported, you have to do the legwork to make it work for your use case".

That's essentially what the status is. The docking branch in this repo just has extra code in the sample application to enable multi-viewports and drive the extra windows, but it's unstable/experimental enough that it has always stayed in its own branch. You should be able to do roughly the same thing from the master branch, or from the NuGet package, although IIRC there's a few extra things that need to be wrapped that exist in the native library that aren't in the master branch.

mellinoe avatar Jul 22 '23 05:07 mellinoe

You should be able to do roughly the same thing from the master branch, or from the NuGet package, although IIRC there's a few extra things that need to be wrapped that exist in the native library that aren't in the master branch.

That makes sense. You do need the docking branch of ImGui, then obviously the appropriate branch for cimgui in order to support it. So this isn't an ImGui.NET issue, it's an upstream issue really. Gotcha.

desiwko avatar Jul 22 '23 13:07 desiwko

You do need the docking branch of ImGui, then obviously the appropriate branch for cimgui in order to support it.

yes imgui.net master branch is doing exactly that. Actually to be 100% clear the demo code in imgui.net repo master branch can do docking feature with 0 code change ( you just have to enable the docking flag ).

It's the (add,remove,get,update) viewport part which you folks are really talking about.

zaafar avatar Jul 22 '23 13:07 zaafar

Keep in mind that when using viewports ImGui expects the input events to be in raw screen space coordinate, so you might have to do some coordinate conversions.

could you show example?

kateusz avatar Apr 13 '24 01:04 kateusz