// FIXME-DOCKING: This is failing (lagging by one frame) for docked windows.
// FIXME-DOCK: This is failing (lagging by one frame) for docked windows.
// If A and B are docked into window and B disappear, at the NewFrame() call site window->NavLastChildNavWindow will still point to B.
// If A and B are docked into window and B disappear, at the NewFrame() call site window->NavLastChildNavWindow will still point to B.
// We might leverage the tab order implicitly stored in window->DockNodeAsHost->TabBar (essentially the 'most_recently_selected_tab' code in tab bar will do that but on next update)
// We might leverage the tab order implicitly stored in window->DockNodeAsHost->TabBar (essentially the 'most_recently_selected_tab' code in tab bar will do that but on next update)
// to tell which is the "previous" window. Or we may leverage 'LastFrameFocused/LastFrameJustFocused' and have this function handle child window itself?
// to tell which is the "previous" window. Or we may leverage 'LastFrameFocused/LastFrameJustFocused' and have this function handle child window itself?
// Generate an ID for new node (the exact ID value doesn't matter as long as it is not already used)
// Generate an ID for new node (the exact ID value doesn't matter as long as it is not already used)
// FIXME-OPT FIXME-DOCKING: This is suboptimal, even if the node count is small enough not to be a worry. We should poke in ctx->Nodes to find a suitable ID faster.
// FIXME-OPT FIXME-DOCK: This is suboptimal, even if the node count is small enough not to be a worry. We should poke in ctx->Nodes to find a suitable ID faster.
// FIXME-DOCKING: Consider only clearing the flag after the tab has been alive for a few consecutive frames, allowing late comers to not break sorting?
// FIXME-DOCK: Consider only clearing the flag after the tab has been alive for a few consecutive frames, allowing late comers to not break sorting?
buf->appendf(" ; in '%s'",node->HostWindow->ParentWindow->Name);
buf->appendf(" ; in '%s'",node->HostWindow->ParentWindow->Name);
// Iterate settings so we can give info about windows that didn't exist during the session.
intcontains_window=0;
intcontains_window=0;
for(intwindow_n=0;window_n<ctx->SettingsWindows.Size;window_n++)// Iterate settings so we can give info about windows that didn't exist during the session.