mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Docking: Disable SkipItems when directly/programmatically focused (possible generalization of code currently in BeginDocked which relies on tab bar interaction, will remove that code in next commit). (#2453, #2109)
This commit is contained in:
@ -2587,6 +2587,7 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
||||
SetWindowPosVal = SetWindowPosPivot = ImVec2(FLT_MAX, FLT_MAX);
|
||||
|
||||
LastFrameActive = -1;
|
||||
LastFrameJustFocused = -1;
|
||||
ItemWidthDefault = 0.0f;
|
||||
FontWindowScale = FontDpiScale = 1.0f;
|
||||
SettingsIdx = -1;
|
||||
@ -6070,7 +6071,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
g.NextWindowData.Clear();
|
||||
|
||||
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)
|
||||
{
|
||||
@ -6219,6 +6225,7 @@ void ImGui::FocusWindow(ImGuiWindow* window)
|
||||
// Passing NULL allow to disable keyboard focus
|
||||
if (!window)
|
||||
return;
|
||||
window->LastFrameJustFocused = g.FrameCount;
|
||||
|
||||
// Select in dock node
|
||||
if (window->DockNode && window->DockNode->TabBar)
|
||||
|
Reference in New Issue
Block a user