The existing fullscreen implementation simply opens a window to the size
of the desktop (while creating a context of the requested mode size).
This change tests the requested fullscreen mode for validity and, if the
mode is a valid hardware mode, switches the main display to the
requested mode. The original mode is retained so that when the window
is deallocated, the desktop can be restored to the user's normal display
This could be further improved by offering the option to fullscreen onto
another display, but that requires multi-display support higher up in
SFML as a prerequisite.
application window loses focus.
As a consequence of performing a true mode switch on fullscreen window
creation, the desktop will no longer be at the user's normal operating
resolution while the SFML application is running. This change resolves
that issue by performing a mode switch back to the original mode
whenever the application window loses key focus.