DeviceWorkstation.st
changeset 7564 5330f64092a5
parent 7545 f2e7a120a2bf
child 7574 b5c9b6c231f7
equal deleted inserted replaced
7563:3555a447b0aa 7564:5330f64092a5
  4732      We only do this for displays other that the default Display."
  4732      We only do this for displays other that the default Display."
  4733 
  4733 
  4734     dispatching ifFalse:[^ self].
  4734     dispatching ifFalse:[^ self].
  4735 
  4735 
  4736     self == Display ifTrue:[
  4736     self == Display ifTrue:[
  4737 	ExitOnLastClose == true ifFalse:[^ self].
  4737         ExitOnLastClose == true ifFalse:[^ self].
  4738     ].
  4738     ].
  4739     exitOnLastClose == true ifFalse:[^ self].
  4739     exitOnLastClose == true ifFalse:[^ self].
  4740 
  4740 
  4741     knownViews notNil ifTrue:[
  4741     knownViews notNil ifTrue:[
  4742 	"/ if there is no non-popup topview, stop dispatching
  4742         "/ if there is no non-popup topview, stop dispatching
  4743 	(knownViews contains:[:slot |
  4743         (knownViews contains:[:slot |
  4744 		slot notNil
  4744                 slot notNil
  4745 		and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
  4745                 and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
  4746 		and:[true "slot isModal not"
  4746                 and:[true "slot isModal not"
  4747 		"and:[slot realized]"]]]
  4747                 "and:[slot realized]"]]]
  4748 	 ) ifFalse:[
  4748          ) ifFalse:[
  4749 	    "/ my last view was closed
  4749             "/ my last view was closed
  4750 	    dispatching := false.
  4750             dispatching := false.
  4751 	    Logger info:'finished dispatch (last view closed): %1' with:self.
  4751             Logger info:'finished dispatch (last view closed): %1' with:self.
  4752 	    LastActiveScreen == self ifTrue:[
  4752             self releaseDeviceResources.
  4753 		LastActiveScreen := nil.
  4753             eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
  4754 		LastActiveProcess := nil.
  4754         ]
  4755 	    ].
       
  4756 	    eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
       
  4757 	]
       
  4758     ].
  4755     ].
  4759 
  4756 
  4760     "Modified: 19.9.1995 / 11:31:54 / claus"
  4757     "Modified: 19.9.1995 / 11:31:54 / claus"
  4761     "Modified: 18.3.1997 / 10:42:11 / cg"
  4758     "Modified: 18.3.1997 / 10:42:11 / cg"
  4762 !
  4759 !
  6286     "release any cached device resources.
  6283     "release any cached device resources.
  6287      This is invoked when closed or when the display connection is broken
  6284      This is invoked when closed or when the display connection is broken
  6288      (i.e. be prepared to not be able to release resources regularily)"
  6285      (i.e. be prepared to not be able to release resources regularily)"
  6289 
  6286 
  6290     LastActiveScreen == self ifTrue:[
  6287     LastActiveScreen == self ifTrue:[
  6291 	LastActiveScreen := nil.
  6288         LastActiveScreen := nil.
  6292 	LastActiveProcess := nil.
  6289         LastActiveProcess := nil.
  6293     ].
  6290     ].
  6294 
  6291 
  6295     Image releaseResourcesOnDevice:self.
  6292     Image releaseResourcesOnDevice:self.
       
  6293     Icon notNil ifTrue:[
       
  6294         Icon releaseCachedIconsFromDevice:self.
       
  6295     ].
  6296 
  6296 
  6297     "This unregisters all the finalization handles"
  6297     "This unregisters all the finalization handles"
  6298     self releaseGraphicsContexts.
  6298     self releaseGraphicsContexts.
  6299 
  6299 
  6300     blackColor notNil ifTrue:[
  6300     blackColor notNil ifTrue:[
  6301 	blackColor releaseFromDevice.
  6301         blackColor releaseFromDevice.
  6302 	blackColor := nil.
  6302         blackColor := nil.
  6303     ].
  6303     ].
  6304     whiteColor notNil ifTrue:[
  6304     whiteColor notNil ifTrue:[
  6305 	whiteColor releaseFromDevice.
  6305         whiteColor releaseFromDevice.
  6306 	whiteColor := nil.
  6306         whiteColor := nil.
  6307     ].
  6307     ].
  6308     self releaseDeviceColors.
  6308     self releaseDeviceColors.
  6309     self releaseDeviceCursors.
  6309     self releaseDeviceCursors.
  6310     self releaseDeviceFonts.
  6310     self releaseDeviceFonts.
  6311 
  6311