Docking, Tabs: toggling tab bar visibility marks saved settings as dirty. (#9380)

+ tweak/improve packing for ImGuiDockNode.
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 09ee631..8186493 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -177,6 +177,8 @@
 
 Docking+Viewports Branch:
 
+- Docking:
+  - Toggling tab bar visibility marks saved settings as dirty. (#9380)
 - Viewports:
   - Added opaque `void* PlatformIconData` storage in viewport and ImGuiWindowClass
     to allow passing icon information to a custom backend or hook. (#2715)
diff --git a/imgui.cpp b/imgui.cpp
index c9ffc66..cb73b8d 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -18922,10 +18922,13 @@
         node->WantHiddenTabBarToggle = false;
 
     // Apply toggles at a single point of the frame (here!)
+    const ImGuiDockNodeFlags prev_local_flags = node->LocalFlags;
     if (node->Windows.Size > 1)
         node->SetLocalFlags(node->LocalFlags & ~ImGuiDockNodeFlags_HiddenTabBar);
     else if (node->WantHiddenTabBarToggle)
         node->SetLocalFlags(node->LocalFlags ^ ImGuiDockNodeFlags_HiddenTabBar);
+    if ((node->LocalFlags ^ prev_local_flags) & ImGuiDockNodeFlags_SavedFlagsMask_)
+        MarkIniSettingsDirty(); // Bit flaky to only do this here. Perhaps compare node flags every frame? #9380
     node->WantHiddenTabBarToggle = false;
 
     DockNodeUpdateVisibleFlag(node);
diff --git a/imgui_internal.h b/imgui_internal.h
index af03aa3..a9e2cb1 100644
--- a/imgui_internal.h
+++ b/imgui_internal.h
@@ -2031,7 +2031,7 @@
     ImGuiDockNodeState_HostWindowVisible,
 };
 
-// sizeof() 156~192
+// sizeof() 176~216
 struct IMGUI_API ImGuiDockNode
 {
     ImGuiID                 ID;
@@ -2048,8 +2048,8 @@
     ImVec2                  Size;                       // Current size
     ImVec2                  SizeRef;                    // [Split node only] Last explicitly written-to size (overridden when using a splitter affecting the node), used to calculate Size.
     ImGuiAxis               SplitAxis;                  // [Split node only] Split axis (X or Y)
-    ImGuiWindowClass        WindowClass;                // [Root node only]
     ImU32                   LastBgColor;
+    ImGuiWindowClass        WindowClass;                // [Root node only]
 
     ImGuiWindow*            HostWindow;
     ImGuiWindow*            VisibleWindow;              // Generally point to window which is ID is == SelectedTabID, but when CTRL+Tabbing this can be a different window.