mac: Implement window state events