pthom / hello_imgui

Hello, Dear ImGui: unleash your creativity in app development and prototyping
https://pthom.github.io/hello_imgui
MIT License
606 stars 91 forks source link

Main window position is not saved on multi-monitor systems #16

Closed MichaelKv closed 1 year ago

MichaelKv commented 3 years ago

Hello. I use ImGuiConfigFlags_ViewportsEnable setting and hello_imgui_demo_classic.exe does not save the main window position and its size on milti-monitor system.

pthom commented 3 years ago

Hello,

Can you clarify what you mean by "main window" ?

If by "main window", you mean the native window created by the backend (be it SDL, Glfw, or Qt); IMHO imgui in itself (and thus hello_imgui) does not provide any way to remember/restore this as a setting (since this window is created be the backnd long before imgui is inited).

See this answer from the imgui author. This was in 2019, but I suspect this is still valid.

MichaelKv commented 3 years ago

I mean native Windows window. I consider hello_imgui as a windows management system so I believe it shall be responsible for saving/restoring all windows sizes, positions etc. though customers could do such a job themselves indeed.

pthom commented 3 years ago

I understand the need. May be this would be a nice thing to implement, although it needs some more thinking (i.e how to store this in imgui.ini, how to handle the different backends). I keep this issue opened so that the idea stays prominent.

pthom commented 1 year ago

Hi,

Window position can be saved in the latest version. Autosize is also available.

See: https://github.com/pthom/hello_imgui/blob/master/src/hello_imgui/hello_imgui_api.md#application-window-params