mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-12 02:00:58 +01:00
Fixed ParentWindow setup which broke Modal windows (fix c65124f415
)
This commit is contained in:
parent
ef1a683ebe
commit
28bbf1ade6
@ -2387,10 +2387,7 @@ void ImGui::NewFrame()
|
|||||||
if (ImGuiWindow* modal_window = GetFrontMostModalRootWindow())
|
if (ImGuiWindow* modal_window = GetFrontMostModalRootWindow())
|
||||||
{
|
{
|
||||||
g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f);
|
g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f);
|
||||||
ImGuiWindow* window = g.HoveredRootWindow;
|
if (g.HoveredRootWindow && !IsWindowChildOf(g.HoveredRootWindow, modal_window))
|
||||||
while (window && window != modal_window)
|
|
||||||
window = window->ParentWindow;
|
|
||||||
if (!window)
|
|
||||||
g.HoveredRootWindow = g.HoveredWindow = NULL;
|
g.HoveredRootWindow = g.HoveredWindow = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -4341,7 +4338,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true);
|
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, true);
|
||||||
|
|
||||||
// Parent window is latched only on the first call to Begin() of the frame, so further append-calls can be done from a different window stack
|
// Parent window is latched only on the first call to Begin() of the frame, so further append-calls can be done from a different window stack
|
||||||
ImGuiWindow* parent_window = first_begin_of_the_frame ? ((flags & ImGuiWindowFlags_ChildWindow) && !g.CurrentWindowStack.empty() ? g.CurrentWindowStack.back() : NULL) : window->ParentWindow;
|
ImGuiWindow* parent_window = first_begin_of_the_frame ? ((flags & (ImGuiWindowFlags_ChildWindow | ImGuiWindowFlags_Popup)) && !g.CurrentWindowStack.empty() ? g.CurrentWindowStack.back() : NULL) : window->ParentWindow;
|
||||||
IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow));
|
IM_ASSERT(parent_window != NULL || !(flags & ImGuiWindowFlags_ChildWindow));
|
||||||
|
|
||||||
// Add to stack
|
// Add to stack
|
||||||
|
@ -746,7 +746,7 @@ struct IMGUI_API ImGuiWindow
|
|||||||
ImGuiStorage StateStorage;
|
ImGuiStorage StateStorage;
|
||||||
float FontWindowScale; // Scale multiplier per-window
|
float FontWindowScale; // Scale multiplier per-window
|
||||||
ImDrawList* DrawList;
|
ImDrawList* DrawList;
|
||||||
ImGuiWindow* ParentWindow; // If we are a child window, this is pointing to our parent.
|
ImGuiWindow* ParentWindow; // If we are a child _or_ popup window, this is pointing to our parent. Otherwise NULL.
|
||||||
ImGuiWindow* RootWindow; // Generally point to ourself. If we are a child window, this is pointing to the first non-child parent window.
|
ImGuiWindow* RootWindow; // Generally point to ourself. If we are a child window, this is pointing to the first non-child parent window.
|
||||||
ImGuiWindow* RootNonPopupWindow; // Generally point to ourself. Used to display TitleBgActive color and for selecting which window to use for NavWindowing
|
ImGuiWindow* RootNonPopupWindow; // Generally point to ourself. Used to display TitleBgActive color and for selecting which window to use for NavWindowing
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user