mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-31 14:25:49 +08:00
Docking, Viwport: Fixed a regression in 1.92.4 where partially moving a floating docking node with split over the main viewport would set the window in an invalid state.
This was revealed by better merging in dfe308b (#8948) but isn't technically caused by it.
Added a agressive assert in UpdateTryMergeWindowIntoHostViewport() For good measure.
This commit is contained in:
@@ -245,6 +245,10 @@ Docking+Viewports Branch:
|
|||||||
- Demo: rework 'Dockspace' demo to increase clarity and put more emphasis on the
|
- Demo: rework 'Dockspace' demo to increase clarity and put more emphasis on the
|
||||||
basic path of simply calling `DockSpaceOverViewport()`.
|
basic path of simply calling `DockSpaceOverViewport()`.
|
||||||
- Viewports:
|
- Viewports:
|
||||||
|
- Fixed a regression in 1.92.4 where partially moving a floating docking node
|
||||||
|
with horizontal/vertical split over the main viewport would set the window in
|
||||||
|
an invalid state in some situations, making user unable to further interact
|
||||||
|
with the window.
|
||||||
- Fixed a regression in 1.92.4 which could cause combos/popups window from
|
- Fixed a regression in 1.92.4 which could cause combos/popups window from
|
||||||
appearing under their parent viewport if their geometry overlapped the main
|
appearing under their parent viewport if their geometry overlapped the main
|
||||||
viewport. (#8948, #9172, #9131, #9128)
|
viewport. (#8948, #9172, #9131, #9128)
|
||||||
|
|||||||
@@ -5365,7 +5365,7 @@ void ImGui::StopMouseMovingWindow()
|
|||||||
// Try to merge the window back into the main viewport.
|
// Try to merge the window back into the main viewport.
|
||||||
// This works because MouseViewport should be != MovingWindow->Viewport on release (as per code in UpdateViewports)
|
// This works because MouseViewport should be != MovingWindow->Viewport on release (as per code in UpdateViewports)
|
||||||
if (g.ConfigFlagsCurrFrame & ImGuiConfigFlags_ViewportsEnable)
|
if (g.ConfigFlagsCurrFrame & ImGuiConfigFlags_ViewportsEnable)
|
||||||
UpdateTryMergeWindowIntoHostViewport(window, g.MouseViewport);
|
UpdateTryMergeWindowIntoHostViewport(window->RootWindowDockTree, g.MouseViewport);
|
||||||
|
|
||||||
// Restore the mouse viewport so that we don't hover the viewport _under_ the moved window during the frame we released the mouse button.
|
// Restore the mouse viewport so that we don't hover the viewport _under_ the moved window during the frame we released the mouse button.
|
||||||
if (!IsDragDropPayloadBeingAccepted())
|
if (!IsDragDropPayloadBeingAccepted())
|
||||||
@@ -16553,6 +16553,7 @@ static bool IsViewportAbove(ImGuiViewportP* potential_above, ImGuiViewportP* pot
|
|||||||
static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImGuiViewportP* viewport_dst)
|
static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImGuiViewportP* viewport_dst)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
|
IM_ASSERT(window == window->RootWindowDockTree);
|
||||||
ImGuiViewportP* viewport_src = window->Viewport; // Current viewport
|
ImGuiViewportP* viewport_src = window->Viewport; // Current viewport
|
||||||
if (viewport_src == viewport_dst)
|
if (viewport_src == viewport_dst)
|
||||||
return false;
|
return false;
|
||||||
@@ -16576,6 +16577,7 @@ static bool ImGui::UpdateTryMergeWindowIntoHostViewport(ImGuiWindow* window, ImG
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move to the existing viewport, Move child/hosted windows as well (FIXME-OPT: iterate child)
|
// Move to the existing viewport, Move child/hosted windows as well (FIXME-OPT: iterate child)
|
||||||
|
IMGUI_DEBUG_LOG_VIEWPORT("[viewport] Window '%s' merge into Viewport 0X%08X\n", window->Name, viewport_dst->ID);
|
||||||
if (window->ViewportOwned)
|
if (window->ViewportOwned)
|
||||||
for (int n = 0; n < g.Windows.Size; n++)
|
for (int n = 0; n < g.Windows.Size; n++)
|
||||||
if (g.Windows[n]->Viewport == viewport_src)
|
if (g.Windows[n]->Viewport == viewport_src)
|
||||||
|
|||||||
Reference in New Issue
Block a user