Fix handling of window gravity.