Fixed window updating (must fix double buffering)