Fix to bug on Mac where opening new document didn't paint the document.