this is the fix for the nasty flickering window in Issue #419

fix the nasty flickering at window starting.