Fix headless build error and abstract OSK bypass.