That's an interesting observation. I've observed this same UI overhead.
It certainly sounds like you would get the desired result in all cases.
Furthermore, Code::Blocks already has the code to implement this, although it looks like it was implemented as a workaround to handling popup menus potentially existing for the open file.
Here's the current sdk/editorbase.cpp, starting at line 339
else if (id == idCloseAll)
{
if (m_pData->m_DisplayingPopupMenu)
{
Manager::Get()->GetEditorManager()->CloseAllExcept(this);
m_pData->m_CloseMe = true; // defer delete 'this' until after PopupMenu() call returns
}
else
Manager::Get()->GetEditorManager()->CloseAll();
}
I imagine that the change you describe would change the code to this:
else if (id == idCloseAll)
{
Manager::Get()->GetEditorManager()->CloseAllExcept(this);
if (m_pData->m_DisplayingPopupMenu)
m_pData->m_CloseMe = true; // defer delete 'this' until after PopupMenu() call returns
else
Manager::Get()->GetEditorManager()->Close(this);
}
As best I can tell, that change alone would give us the speedup you describe.