hello_imgui icon indicating copy to clipboard operation
hello_imgui copied to clipboard

Main window position is not saved on multi-monitor systems

Open MichaelKv opened this issue 4 years ago • 3 comments
trafficstars

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.

MichaelKv avatar Apr 28 '21 22:04 MichaelKv

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.

pthom avatar Apr 29 '21 11:04 pthom

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.

MichaelKv avatar Apr 29 '21 13:04 MichaelKv

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 avatar May 06 '21 16:05 pthom

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

pthom avatar Nov 20 '22 14:11 pthom