Removing focus from child windows upon hiding them.

When any of the Song Editor, BB Editor, Automation Editor, or Piano Roll windows are hidden or toggled off, they retain focus and capture key events.  The problem here is that the user is unwittingly sending keys to the apparently-closed window rather than only to the main application window.

The problem can be demonstrated by the following steps:

  1. Load a song/project.
  2. Close all child windows other than the Song Editor.
  3. Give focus to the Song Editor window by clicking its title bar.
  4. Hit the [space] key to start playback.
  5. Toggle off the Song Editor by using F5 or clicking the Song Editor toolbar button.
  6. Press [space] again while no child windows are open.

It is then observed that the key events continue to be handled by the (apparently closed) child window, toggling playback.

This happens with any child window that can be toggled and that handles key events; whichever child window was hidden last will continue receiving key events until another child window is explicitly focused by toggling it on or clicking it.

The proposed change restores focus to the parent window when a child window is hidden.