Add WindowInFocus and associated callbacks