In order to prevent flashing of unpainted frame/screenshot overlay during switching from one to another, many event listener & callbacks are employed.

Switching from 'frame' to 'screenshot' state:
- _showScreenshotOverlay() is called
- get screenshot from frame
- when getting the screenshot, show the screenshot overlay and hide the frame

Switching from 'screenshot' to 'frame' state:
- _showFrame() is called
- register next paint listener, and set the frame to visible
- finally, when next painted, hide the screenshot

Switching from 'none' to 'frame' state:

?

Switching from 'none' to 'screenshot' state:

?