[VW 7.4.0] [Bug] Singleton screen included twice in allOpenDevices

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[VW 7.4.0] [Bug] Singleton screen included twice in allOpenDevices

Stew MacLean

Hi,

 

GraphicsDevice>>allOpenDevices

 

Is including the singleton screen twice. This has implications when changing the look, as the whole update gets executed twice.

 

A quick fix is:

 

allOpenDevices

            "Answer a collection of all open graphics devices (screens, printers, etc.).

            Remove erroneous duplicates from the answer. 16/02/07 SIM.

            (caused by double access to Screen registry)."

 

            | openDevices |

            openDevices := OrderedCollection new.

            self allSubclassesDo: [:class | openDevices addAll: class registeredInstances].

            ^openDevices asSet asOrderedCollection

 

Cheers,

 

Stewart

Reply | Threaded
Open this post in threaded view
|

Re: [VW 7.4.0] [Bug] Singleton screen included twice in allOpenDevices

Alan Knight-2
Actually the root of the problem is that HeadlessScreen is also returning the Screen instances. Created AR 51857 for this.

At 02:32 AM 2/16/2007, Stewart MacLean wrote:
Hi,
 
GraphicsDevice>>allOpenDevices
 
Is including the singleton screen twice. This has implications when changing the look, as the whole update gets executed twice.
 
A quick fix is:
 
allOpenDevices
            "Answer a collection of all open graphics devices (screens, printers, etc.).
            Remove erroneous duplicates from the answer. 16/02/07 SIM.
            (caused by double access to Screen registry)."
 
            | openDevices |
            openDevices := OrderedCollection new.
            self allSubclassesDo: [:class | openDevices addAll: class registeredInstances].
            ^openDevices asSet asOrderedCollection
 
Cheers,
 
Stewart

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross