Added window focus tracking to event system