'From etoys2.2 of 24 September 2007 [latest update: #1697] on 10 October 2007 at 8:16:17 pm'! "Change Set: setAsBackgroundFix-sw Date: 10 October 2007 Author: Scott Wallace Fix for TRAC #3888 -- 'After setting the image made from painting as background, Etoys can not work properly'. (This bug, it turns out, has been there forever. I'd never used this feature, nor even really been aware of it until now.) The symptom of the bug is that screen refresh goes haywire -- portions of screen areas damaged, for example, by balloon help or by pop-up menus, were never getting refreshed, even after a 'restore display'. The bug is caused by allowing the InfiniteForm used as the desktop background to have areas of transparency. The morphic refresh logic assumes that the drawing of the world's color will completely erase the screen, but that doesn't happen if the world's color has any translucency, because damaged areas under translucent bits are in fact not cleared, thus leading to the bizarre display phenomena mentioned in the TRAC report. The same phenomenon can be generated by making the world's color be not an InfiniteForm but rather a simple color with any translucency -- the areas behind menus and help balloons will not get refreshed, etc. This would seem to imply that only non-transulcent colors are acceptable as desktop colors... so that's still something that needs to be dealt with."! !Form methodsFor: 'other' stamp: 'sw 10/10/2007 18:11'! setAsBackground "Set this form as a background image." | world newColor aForm | Smalltalk isMorphic ifTrue: [world _ self currentWorld. aForm := self deepCopy. aForm mapColor: Color transparent to: Color white. newColor _ InfiniteForm with: aForm. self rememberCommand: (Command new cmdWording: 'set background to a picture' translated; undoTarget: world selector: #color: argument: world color; redoTarget: world selector: #color: argument: newColor). world color: newColor] ifFalse: [ScheduledControllers screenController model form: self. Display restoreAfter: []]! !