2
0
Эх сурвалжийг харах

Docking: when io.ConfigDockingWithShift is enabled, fixed help tooltip erroneously reading SetNextWindowXXX() data. (#6709, #4643, #7491)

ocornut 1 жил өмнө
parent
commit
c1743eef48
2 өөрчлөгдсөн 19 нэмэгдсэн , 1 устгасан
  1. 14 0
      docs/CHANGELOG.txt
  2. 5 1
      imgui.cpp

+ 14 - 0
docs/CHANGELOG.txt

@@ -35,6 +35,20 @@ HOW TO UPDATE?
   and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users.
 - Please report any issue!
 
+-----------------------------------------------------------------------
+ VERSION 1.90.6 WIP (In Progress)
+-----------------------------------------------------------------------
+
+Breaking changes:
+
+Other changes:
+
+Docking+Viewports Branch:
+
+- Docking: when io.ConfigDockingWithShift is enabled, fixed help tooltip erroneously
+  reading SetNextWindowXXX() data. (#6709, #4643, #7491) [@ocornut, @cfillion]
+
+
 -----------------------------------------------------------------------
  VERSION 1.90.5 (Released 2024-04-11)
 -----------------------------------------------------------------------

+ 5 - 1
imgui.cpp

@@ -7445,6 +7445,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
         if (window->AutoFitFramesY > 0)
             window->AutoFitFramesY--;
 
+        // Clear SetNextWindowXXX data (can aim to move this higher in the function)
+        g.NextWindowData.ClearFlags();
+
         // Apply focus (we need to call FocusWindow() AFTER setting DC.CursorStartPos so our initial navigation reference rectangle can start around there)
         // We ImGuiFocusRequestFlags_UnlessBelowModal to:
         // - Avoid focusing a window that is created outside of a modal. This will prevent active modal from being closed.
@@ -7517,6 +7520,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
         // Append
         SetCurrentViewport(window, window->Viewport);
         SetCurrentWindow(window);
+        g.NextWindowData.ClearFlags();
     }
 
     if (!(flags & ImGuiWindowFlags_DockNodeHost))
@@ -7525,7 +7529,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
     // Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused)
     window->WriteAccessed = false;
     window->BeginCount++;
-    g.NextWindowData.ClearFlags();
 
     // Update visibility
     if (first_begin_of_the_frame)
@@ -19143,6 +19146,7 @@ void ImGui::BeginDockableDragDropSource(ImGuiWindow* window)
         // When ConfigDockingWithShift is set, display a tooltip to increase UI affordance.
         // We cannot set for HoveredWindowUnderMovingWindow != NULL here, as it is only valid/useful when drag and drop is already active
         // (because of the 'is_mouse_dragging_with_an_expected_destination' logic in UpdateViewportsNewFrame() function)
+        IM_ASSERT(g.NextWindowData.Flags == 0);
         if (g.IO.ConfigDockingWithShift && g.MouseStationaryTimer >= 1.0f && g.ActiveId >= 1.0f)
             SetTooltip("%s", LocalizeGetMsg(ImGuiLocKey_DockingHoldShiftToDock));
         return;