Christoph Thiede uploaded a new version of Morphic to project The Inbox: http://source.squeak.org/inbox/Morphic-ct.2148.mcz
==================== Summary ====================
Name: Morphic-ct.2148 Author: ct Time: 7 December 2023, 7:31:26.443108 pm UUID: b74139ee-af71-b64d-9b8d-0950fd862bbd Ancestors: Morphic-mt.2147
Fixes a remarkable slip that (1) prevented collapsed windows from applying a new UI theme and (2) introduced a possibly significant memory leak*. Note that #userInterfaceTheme answer a UserInterfaceThemeRequest which forwards all one-argument selectors as setters to the actual theme.
*To reproduce this in an older image, open a workspace, evaluate o := Array new: 100000000, collapse the window, change the UI theme, expand the window, close it, purge all undos and run GC, and the workspace with its large binding will still be referenced in the UI theme.
=============== Diff against Morphic-mt.2147 ===============
Item was changed: ----- Method: SystemWindow>>collapseOrExpand (in category 'resize/collapse') ----- collapseOrExpand "Collapse or expand the window, depending on existing state" | cf | isCollapsed ifTrue: ["Expand -- restore panes to morphics structure" isCollapsed := false. self beKeyWindow. "Bring to frint first" Preferences collapseWindowsInPlace ifTrue: [fullFrame := fullFrame align: fullFrame topLeft with: self getBoundsWithFlex topLeft] ifFalse: [collapsedFrame := self getBoundsWithFlex]. collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse this window' translated]. self setBoundsWithFlex: fullFrame. paneMorphs reverseDo: [:m | self addMorph: m unlock. self world startSteppingSubmorphsOf: m]. self addPaneSplitters. (self hasProperty: #applyTheme) ifTrue: [ self removeProperty: #applyTheme. + UserInterfaceTheme current applyTo: self allMorphs]] - self userInterfaceTheme applyTo: self allMorphs]] ifFalse: ["Collapse -- remove panes from morphics structure" isCollapsed := true. fullFrame := self getBoundsWithFlex. "First save latest fullFrame" paneMorphs do: [:m | m delete; releaseCachedState]. self removePaneSplitters. self removeCornerGrips. model modelSleep. cf := self getCollapsedFrame. (collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue: [collapsedFrame := cf]. self setBoundsWithFlex: cf. collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window' translated ]. expandBox ifNotNil: [expandBox setBalloonText: 'expand this window' translated ]. self isInWorld ifTrue: [self sendToBack]]. self layoutChanged.!
What can this slip tell us further?
* It might be confusing that #userInterfaceTheme does not answer a UserInterfaceTheme. (Though I understand the idea behind it and like the automatic scoping behavior.) * It might be confusing that a UserInterfaceThemeRequest does not only support read but also write accesses. * chasePointers is an extremely useful tool for investigating memory leaks in Squeak. :-)
Anyway, this was a funny one. :-)
Best, Christoph ________________________________ Von: commits@source.squeak.org commits@source.squeak.org Gesendet: Donnerstag, 7. Dezember 2023 19:31 Uhr An: squeak-dev@lists.squeakfoundation.org squeak-dev@lists.squeakfoundation.org Betreff: [squeak-dev] The Inbox: Morphic-ct.2148.mcz
Christoph Thiede uploaded a new version of Morphic to project The Inbox: http://source.squeak.org/inbox/Morphic-ct.2148.mcz
==================== Summary ====================
Name: Morphic-ct.2148 Author: ct Time: 7 December 2023, 7:31:26.443108 pm UUID: b74139ee-af71-b64d-9b8d-0950fd862bbd Ancestors: Morphic-mt.2147
Fixes a remarkable slip that (1) prevented collapsed windows from applying a new UI theme and (2) introduced a possibly significant memory leak*. Note that #userInterfaceTheme answer a UserInterfaceThemeRequest which forwards all one-argument selectors as setters to the actual theme.
*To reproduce this in an older image, open a workspace, evaluate o := Array new: 100000000, collapse the window, change the UI theme, expand the window, close it, purge all undos and run GC, and the workspace with its large binding will still be referenced in the UI theme.
=============== Diff against Morphic-mt.2147 ===============
Item was changed: ----- Method: SystemWindow>>collapseOrExpand (in category 'resize/collapse') ----- collapseOrExpand "Collapse or expand the window, depending on existing state" | cf | isCollapsed ifTrue: ["Expand -- restore panes to morphics structure" isCollapsed := false. self beKeyWindow. "Bring to frint first" Preferences collapseWindowsInPlace ifTrue: [fullFrame := fullFrame align: fullFrame topLeft with: self getBoundsWithFlex topLeft] ifFalse: [collapsedFrame := self getBoundsWithFlex]. collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse this window' translated]. self setBoundsWithFlex: fullFrame. paneMorphs reverseDo: [:m | self addMorph: m unlock. self world startSteppingSubmorphsOf: m]. self addPaneSplitters. (self hasProperty: #applyTheme) ifTrue: [ self removeProperty: #applyTheme. + UserInterfaceTheme current applyTo: self allMorphs]] - self userInterfaceTheme applyTo: self allMorphs]] ifFalse: ["Collapse -- remove panes from morphics structure" isCollapsed := true. fullFrame := self getBoundsWithFlex. "First save latest fullFrame" paneMorphs do: [:m | m delete; releaseCachedState]. self removePaneSplitters. self removeCornerGrips. model modelSleep. cf := self getCollapsedFrame. (collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue: [collapsedFrame := cf]. self setBoundsWithFlex: cf. collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window' translated ]. expandBox ifNotNil: [expandBox setBalloonText: 'expand this window' translated ]. self isInWorld ifTrue: [self sendToBack]]. self layoutChanged.!
+1
Am 07.12.2023 19:31:52 schrieb commits@source.squeak.org commits@source.squeak.org:
Christoph Thiede uploaded a new version of Morphic to project The Inbox: http://source.squeak.org/inbox/Morphic-ct.2148.mcz
==================== Summary ====================
Name: Morphic-ct.2148 Author: ct Time: 7 December 2023, 7:31:26.443108 pm UUID: b74139ee-af71-b64d-9b8d-0950fd862bbd Ancestors: Morphic-mt.2147
Fixes a remarkable slip that (1) prevented collapsed windows from applying a new UI theme and (2) introduced a possibly significant memory leak*. Note that #userInterfaceTheme answer a UserInterfaceThemeRequest which forwards all one-argument selectors as setters to the actual theme.
*To reproduce this in an older image, open a workspace, evaluate o := Array new: 100000000, collapse the window, change the UI theme, expand the window, close it, purge all undos and run GC, and the workspace with its large binding will still be referenced in the UI theme.
=============== Diff against Morphic-mt.2147 ===============
Item was changed: ----- Method: SystemWindow>>collapseOrExpand (in category 'resize/collapse') ----- collapseOrExpand "Collapse or expand the window, depending on existing state" | cf | isCollapsed ifTrue: ["Expand -- restore panes to morphics structure" isCollapsed := false. self beKeyWindow. "Bring to frint first" Preferences collapseWindowsInPlace ifTrue: [fullFrame := fullFrame align: fullFrame topLeft with: self getBoundsWithFlex topLeft] ifFalse: [collapsedFrame := self getBoundsWithFlex]. collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse this window' translated]. self setBoundsWithFlex: fullFrame. paneMorphs reverseDo: [:m | self addMorph: m unlock. self world startSteppingSubmorphsOf: m]. self addPaneSplitters. (self hasProperty: #applyTheme) ifTrue: [ self removeProperty: #applyTheme. + UserInterfaceTheme current applyTo: self allMorphs]] - self userInterfaceTheme applyTo: self allMorphs]] ifFalse: ["Collapse -- remove panes from morphics structure" isCollapsed := true. fullFrame := self getBoundsWithFlex. "First save latest fullFrame" paneMorphs do: [:m | m delete; releaseCachedState]. self removePaneSplitters. self removeCornerGrips. model modelSleep. cf := self getCollapsedFrame. (collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue: [collapsedFrame := cf]. self setBoundsWithFlex: cf. collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window' translated ]. expandBox ifNotNil: [expandBox setBalloonText: 'expand this window' translated ]. self isInWorld ifTrue: [self sendToBack]]. self layoutChanged.!
squeak-dev@lists.squeakfoundation.org