Suppose that I do M-x blabla without pressing return and then I switch to the main buffer. If the curser is at minibuffer I can cancel the mini-buffer by the shortcut C-g. But if the cursor is at the main buffer, this shortcut doesn't cancel the minibuffer. If I press M-x the error Command attempted to use minibuffer while in minibuffer appears.
Is there a build-in shorcut that completely cancels the previously non-completed contents of the minibuffer since the main buffer.