Since this runs every time the foreground application changes, reduce the number...