同步更新

Don't reference win after dispatching mouse event. Because the child
widget might destory the window.

Reported-by: softwind on the forum