Expected behaviour: I expect to get back to the same state that I was in.

Actual behaviour: VirtualBox captures the keyboard unwantedly. I have to consciously realise that it is VirtualBox that I Alt-Tabbed to and uncapture the keyboard before I can alt-tab away from it again.

Suggested fix: Never capture the keyboard automatically. Only ever capture the keyboard when the user explicitly presses the keyboard-capture key. If the current behaviour (automatic capturing) is desirable, by all means keep it as default, but add an option to disable it.