'From etoys4.0 of 9 October 2008 [latest update: #2212] on 4 April 2009 at 5:34:31 pm'! "Change Set: fixBlackScreen-yo Date: 4 April 2009 Author: Yoshiki Ohshima Avoid black screen flashing when switching same-sized project with display scale enabled for both. "! !Project methodsFor: 'initialization' stamp: 'yo 4/4/2009 17:32'! installVirtualDisplayIfNeededFor: ext | actual allowance | allowance := 50. actual := Display class actualScreenSize. actual = OLPCVirtualScreen defaultVirtualScreenExtent ifTrue: [^ self]. (Display isVirtualScreen and: [Display extent = ext]) ifTrue: [^ self]. ((ext x > (actual x + allowance)) or: [ext y > (actual y + allowance)]) ifTrue: [ OLPCVirtualScreen virtualScreenExtent: ext. OLPCVirtualScreen install. ^ self ]. ((ext x <= (actual x - allowance)) and: [ext y <= (actual y - allowance)]) ifTrue: [ OLPCVirtualScreen virtualScreenExtent: ext. OLPCVirtualScreen install. Display zoomOut: true. ^ self. ]. OLPCVirtualScreen virtualScreenExtent: nil. OLPCVirtualScreen unInstall. ! !