X11-deviceHandle fix:
unregister all child-handles, when a view-handle gets
finalized (because the X11 server internally invalidates
and reuses those handles)
--- a/DisplaySurface.st Mon Dec 12 11:06:36 2005 +0100
+++ b/DisplaySurface.st Mon Dec 12 11:10:33 2005 +0100
@@ -2146,9 +2146,11 @@
destroyView
"physically destroy the view."
- drawableId notNil ifTrue:[
- device destroyView:self withId:drawableId.
+ |id|
+
+ (id := drawableId) notNil ifTrue:[
drawableId := nil.
+ device destroyView:self withId:id.
realized := false.
].
!
@@ -2156,9 +2158,11 @@
destroyed
"view has been destroyed by someone else"
- drawableId notNil ifTrue:[
- device removeKnownView:self withId:drawableId.
+ |id|
+
+ (id := drawableId) notNil ifTrue:[
drawableId := nil.
+ device removeKnownView:self withId:id.
realized := false.
].
self destroy
@@ -2440,40 +2444,41 @@
|id|
drawableId notNil ifTrue:[
- [
- (device viewIdKnown:drawableId) ifTrue:[
+ [
+ (device viewIdKnown:drawableId) ifTrue:[
"/ 'Display [info]: recycled view (' infoPrint. v infoPrint. ') not destroyed: ' infoPrint.
"/ drawableId displayString infoPrintCR.
- drawableId := nil.
- ] ifFalse:[
- (id := gcId) notNil ifTrue:[
- gcId := nil.
- device deviceIOErrorSignal handle:[:ex |
- ] do:[
- device destroyGC:id.
- ]
- ].
-
- "/ care for lost-view trouble:
- "/ if the windowID is still registered,
- "/ this may be due to a not-yet-reclaimed
- "/ subview of a view which has already been destroyed
- "/ (X recycles window handles.)
- "/ In this case, we arrive here with a nil-view argument,
- "/ and a windowId, which is already reused for some other view.
- "/ The situation is detected by finding a non-nil (and non-zero)
- "/ view in the devices id<->view table for the given windowId.
+ drawableId := nil.
+ ] ifFalse:[
+ (id := gcId) notNil ifTrue:[
+ gcId := nil.
+ device deviceIOErrorSignal handle:[:ex |
+ ] do:[
+ device destroyGC:id.
+ ]
+ ].
+
+ "/ care for lost-view trouble:
+ "/ if the windowID is still registered,
+ "/ this may be due to a not-yet-reclaimed
+ "/ subview of a view which has already been destroyed
+ "/ (X recycles window handles.)
+ "/ In this case, we arrive here with a nil-view argument,
+ "/ and a windowId, which is already reused for some other view.
+ "/ The situation is detected by finding a non-nil (and non-zero)
+ "/ view in the devices id<->view table for the given windowId.
"/ 'GC destroy: ' print. drawableId displayString printCR.
"/ device checkKnownViewId:drawableId.
- id := drawableId.
- drawableId := nil.
- device deviceIOErrorSignal handle:[:ex |
- ] do:[
- device destroyView:nil withId:id.
- ]
- ]
- ] valueUninterruptably.
+ id := drawableId.
+ drawableId := nil.
+ device deviceIOErrorSignal handle:[:ex |
+ ] do:[
+ device destroyView:nil withId:id.
+ ].
+ DeviceGraphicsContext cleanupLobbyForChildrenOfViewWithId:id.
+ ]
+ ] valueUninterruptably.
].
"Created: / 25.9.1997 / 10:01:46 / stefan"
@@ -2483,7 +2488,7 @@
!DisplaySurface class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.125 2005-07-26 08:51:26 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/DisplaySurface.st,v 1.126 2005-12-12 10:10:33 cg Exp $'
! !
DisplaySurface initialize!