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

Loading an .ini file during runtime does not respect HideTabBar property #7214

Open
slajerek opened this issue Jan 10, 2024 · 0 comments
Open
Labels
docking settings .ini persistance

Comments

@slajerek
Copy link

slajerek commented Jan 10, 2024

Version/Branch of Dear ImGui:

v1.90.1 WIP, Branch: docking commit 96b5b17

Back-ends:

imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

macOS

Full config/build information:

Dear ImGui 1.90.1 WIP (19002)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 4, sizeof(ImDrawVert): 20
define: __cplusplus=201703
define: __APPLE__
define: __GNUC__=4
define: __clang_version__=14.0.3 (clang-1403.0.22.14.1)
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_sdl2
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000040
 DockingEnable
io.ConfigViewportsNoDecoration
io.ConfigDockingWithShift
io.ConfigMacOSXBehaviors
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigWindowsMoveFromTitleBarOnly
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000140E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 2048,2048
io.DisplaySize: 1240.00,705.00
io.DisplayFramebufferScale: 2.00,2.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

I implemented loading of ini during runtime to support storing and restoring of layouts in my app some months ago. Before calling NewFrame I am loading ini settings via LoadIniSettingsFromMemory before BeginFrame and it works quite OK, but there's one problem:

When ini layout is loaded sometimes HideTabBar setting is not applied to a DockNode, i.e. even though DockNode has HideTabBar set in the ini file, it is not updated after ini load. Consecutive load of ini file after frame is rendered sets that flag correctly.

Reference #2573

I explored source code of ImGui a bit and this may be related to node->WantHiddenTabBarToggle not being populated or respected somewhere.

Screenshots/Video:

Example video: https://www.youtube.com/watch?v=M284CHNAgzY
Example ini from the video above: imgui-ini-hidetabbar.txt

In this example video I have ini loaded called "Screen" with the HideTabBar flag set to "C64 Screen" (DockNode 0x000E), and then I switch layouts and I am loading ini called "Debugger". That works OK, then I am loading back "Screen" and the HideTabBar flag is not set even though it is set in the ini file, that's not correct. Then I am again loading "Screen" and it is set properly. The ini file has the same contents and is not being changed/replaced, i.e. I always load the same ini file data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docking settings .ini persistance
Projects
None yet
Development

No branches or pull requests

2 participants