Fixed a menu bug (settings menu flashing for one frame)

Fixes #1107.