This reverts the last few commits which worked around a focus bug in GTK. This bug is now (I hope) fixed, so I'm dropping the workarounds so the tests will confirm whether it's fixed.