add support for focus gained and focus lost events