fix flickering Issue #419

fix the nasty flickering at window starting.
Merge pull request #475 from punker76/master

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