fix flickering Issue #419

fix the nasty flickering at window starting.