|
@@ -2587,6 +2587,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
|
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
|
|
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
|
|
|
|
|
|
LastFrameActive = -1;
|
|
LastFrameActive = -1;
|
|
|
|
+ LastFrameJustFocused = -1;
|
|
ItemWidthDefault = 0.0f;
|
|
ItemWidthDefault = 0.0f;
|
|
FontWindowScale = FontDpiScale = 1.0f;
|
|
FontWindowScale = FontDpiScale = 1.0f;
|
|
SettingsIdx = -1;
|
|
SettingsIdx = -1;
|
|
@@ -6070,7 +6071,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
g.NextWindowData.Clear();
|
|
g.NextWindowData.Clear();
|
|
|
|
|
|
if (window->DockIsActive && !window->DockTabIsVisible)
|
|
if (window->DockIsActive && !window->DockTabIsVisible)
|
|
- window->HiddenFramesCanSkipItems = 1;
|
|
|
|
|
|
+ {
|
|
|
|
+ if (window->LastFrameJustFocused == g.FrameCount) // This may be a better a generalization for the code in BeginDocked() setting the same field.
|
|
|
|
+ window->HiddenFramesCannotSkipItems = 1;
|
|
|
|
+ else
|
|
|
|
+ window->HiddenFramesCanSkipItems = 1;
|
|
|
|
+ }
|
|
|
|
|
|
if (flags & ImGuiWindowFlags_ChildWindow)
|
|
if (flags & ImGuiWindowFlags_ChildWindow)
|
|
{
|
|
{
|
|
@@ -6219,6 +6225,7 @@ void ImGui::FocusWindow(ImGuiWindow* window)
|
|
// Passing NULL allow to disable keyboard focus
|
|
// Passing NULL allow to disable keyboard focus
|
|
if (!window)
|
|
if (!window)
|
|
return;
|
|
return;
|
|
|
|
+ window->LastFrameJustFocused = g.FrameCount;
|
|
|
|
|
|
// Select in dock node
|
|
// Select in dock node
|
|
if (window->DockNode && window->DockNode->TabBar)
|
|
if (window->DockNode && window->DockNode->TabBar)
|