A rework of #1237. See there for details.
We need the window to become key when events are sent to it so that things like clicking the 'x' button works.
Are we working round an OS X bug? I think that's normal now :)
make sure docking windows close when the x button is pressed
For the first time in memory, I think these windows operate correctly. Well done. :-)
And with that merge, I need to start keeping track of changes for the next release. Note the optimism in the title. :-)