windows: moved fg/bg flip into macro