Avoid un-necessary video mode changes.

Fixes #11494
(cherry picked from commit 8aca90207ffffc9dd512fa11cd9d88d1f4b5884f)
minor code cleanup.

Following 8aca90207ffffc9dd512fa11cd9d88d1f4b5884f, remove useless test and tidy-up
(cherry picked from commit 4e23172d774cf36a45b7b7f382797a9887fa6de6)