>(5) if the close company is selected from the menu ( and it should be disabled ( = skip for) as long as there is a screen active
> - clear the company context
> - remove the application menu
> - go to (1)
The disabled part is crucial here - there should be no way to switch to company B as long as there's something open from company A. This needs to be clear switching, not parallel work.
And even the application menu doesn't necessarily need to be rebuilt, unless it contains company specific items.