Uniform Close button placement

Here the Close button is in the upper left corner,
OK, we close it.
Now in the same spot is the previous menu,
But clicking in the same spot will do something different.
It should do the same thing: close what we are looking at. Yes, even if there is a different way to do that.
The only risk is if one jitters when clicking, thus nailing both menus. Then both menus will close.