Close GH-546: Fix for exit-fullscreen bug in 4.0. fixes #497.