added fullscreen detection

Exception handling is expensive, if possible we should avoid causing an exception.