Reimplemented Window.clear to reduce flickering. Fixed Window.getSize().