<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
-1<div><br></div><div>It makes no sense to officially support a "nil" argument in this protocol.</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div><blockquote class='history_container' type='cite' style='border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;'>
<p style='color: #AAAAAA; margin-top: 10px;'>Am 15.06.2021 16:00:56 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style='font-family:Arial,Helvetica,sans-serif'>A new version of System was added to project The Inbox:<br>http://source.squeak.org/inbox/System-ct.1236.mcz<br><br>==================== Summary ====================<br><br>Name: System-ct.1236<br>Author: ct<br>Time: 15 June 2021, 4:00:40.522222 pm<br>UUID: f7bb410f-d6de-b242-b769-a558aa5a4254<br>Ancestors: System-dtl.1235<br><br>Fixes RealEstateAgent intolerance with a nil world which must be handled according to senders. Document the fact that world can be nil in all relevant senders. I struggled about this when I encountered a recursive project error. See StandardSystemView >> #initialFrame.<br><br>=============== Diff against System-dtl.1235 ===============<br><br>Item was changed:<br> ----- Method: RealEstateAgent class>>initialFrameAtPointerFor:initialExtent:world: (in category 'framing - private') -----<br>+ initialFrameAtPointerFor: aView initialExtent: scaledExtent world: aWorldOrNil<br>+ ^((aWorldOrNil ifNil: [0 @ 0] ifNotNil: [aWorldOrNil cursorPoint - (50@10) "puts use with the mouse ptr just to the right of the menu button"])<br>- initialFrameAtPointerFor: aView initialExtent: scaledExtent world: aWorld<br>- ^(aWorld cursorPoint - (50@10) "puts use with the mouse ptr just to the right of the menu button"<br> extent: scaledExtent)<br>+ translatedAndSquishedToBeWithin: (self maximumUsableAreaInWorld: aWorldOrNil)!<br>- translatedAndSquishedToBeWithin: (self maximumUsableAreaInWorld: aWorld)!<br><br>Item was changed:<br> ----- Method: RealEstateAgent class>>initialFrameFor:initialExtent:world: (in category 'framing') -----<br>+ initialFrameFor: aView initialExtent: initialExtent world: aWorldOrNil<br>- initialFrameFor: aView initialExtent: initialExtent world: aWorld<br> | scaledExtent |<br> scaledExtent := (initialExtent * self scaleFactor) rounded.<br> <br> self placeWindowsAtPointer ifTrue: <br>+ [^self initialFrameAtPointerFor: aView initialExtent: scaledExtent world: aWorldOrNil].<br>- [^self initialFrameAtPointerFor: aView initialExtent: scaledExtent world: aWorld].<br> <br> ^ Preferences reverseWindowStagger<br>+ ifTrue: [self strictlyStaggeredInitialFrameFor: aView initialExtent: scaledExtent world: aWorldOrNil]<br>+ ifFalse: [self normalInitialFrameFor: aView initialExtent: scaledExtent world: aWorldOrNil]!<br>- ifTrue: [self strictlyStaggeredInitialFrameFor: aView initialExtent: scaledExtent world: aWorld]<br>- ifFalse: [self normalInitialFrameFor: aView initialExtent: scaledExtent world: aWorld]!<br><br>Item was changed:<br> ----- Method: RealEstateAgent class>>initialFrameFor:world: (in category 'framing') -----<br>+ initialFrameFor: aView world: aWorldOrNil<br>- initialFrameFor: aView world: aWorld<br> "Find a plausible initial screen area for the supplied view. See called method."<br> <br>+ ^ self initialFrameFor: aView initialExtent: aView initialExtent world: aWorldOrNil!<br>- ^ self initialFrameFor: aView initialExtent: aView initialExtent world: aWorld!<br><br>Item was changed:<br> ----- Method: RealEstateAgent class>>normalInitialFrameFor:initialExtent:world: (in category 'framing - private') -----<br>+ normalInitialFrameFor: aView initialExtent: initialExtent world: aWorldOrNil<br>- normalInitialFrameFor: aView initialExtent: initialExtent world: aWorld<br> "Find a plausible initial screen area for the supplied view, which should be a StandardSystemView, taking into account the 'reverseWindowStagger' Preference, the size needed, and other windows currently on the screen."<br> <br> | allOrigins screenRight screenBottom putativeOrigin putativeFrame allowedArea staggerOrigin otherFrames |<br> <br>+ allowedArea := self maximumUsableAreaInWorld: aWorldOrNil.<br>- allowedArea := self maximumUsableAreaInWorld: aWorld.<br> screenRight := allowedArea right.<br> screenBottom := allowedArea bottom.<br> <br> otherFrames := Smalltalk isMorphic<br>+ ifTrue: [(SystemWindow windowsIn: aWorldOrNil satisfying: [:w | w isCollapsed not])<br>- ifTrue: [(SystemWindow windowsIn: aWorld satisfying: [:w | w isCollapsed not])<br> collect: [:w | w bounds]]<br> ifFalse: [ScheduledControllers scheduledWindowControllers<br> select: [:aController | aController view ~~ nil]<br> thenCollect: [:aController | aController view isCollapsed<br> ifTrue: [aController view expandedFrame]<br> ifFalse: [aController view displayBox]]].<br> <br> allOrigins := otherFrames collect: [:f | f origin].<br>+ (self standardPositionsInWorld: aWorldOrNil) do: "First see if one of the standard positions is free"<br>- (self standardPositionsInWorld: aWorld) do: "First see if one of the standard positions is free"<br> [:aPosition | (allOrigins includes: aPosition)<br> ifFalse:<br> [^ (aPosition extent: initialExtent) translatedAndSquishedToBeWithin: allowedArea]].<br> <br>+ staggerOrigin := (self standardPositionsInWorld: aWorldOrNil) first. "Fallback: try offsetting from top left"<br>- staggerOrigin := (self standardPositionsInWorld: aWorld) first. "Fallback: try offsetting from top left"<br> putativeOrigin := staggerOrigin.<br> <br> [putativeOrigin := putativeOrigin + StaggerOffset.<br> putativeFrame := putativeOrigin extent: initialExtent.<br> (putativeFrame bottom < screenBottom) and:<br> [putativeFrame right < screenRight]]<br> whileTrue:<br> [(allOrigins includes: putativeOrigin)<br> ifFalse:<br> [^ (putativeOrigin extent: initialExtent) translatedAndSquishedToBeWithin: allowedArea]].<br> ^ (self scrollBarSetback @ self screenTopSetback extent: initialExtent) translatedAndSquishedToBeWithin: allowedArea!<br><br>Item was changed:<br> ----- Method: RealEstateAgent class>>strictlyStaggeredInitialFrameFor:initialExtent:world: (in category 'framing - private') -----<br>+ strictlyStaggeredInitialFrameFor: aStandardSystemView initialExtent: initialExtent world: aWorldOrNil<br>- strictlyStaggeredInitialFrameFor: aStandardSystemView initialExtent: initialExtent world: aWorld<br> "This method implements a staggered window placement policy that I (di) like.<br> Basically it provides for up to 4 windows, staggered from each of the 4 corners.<br> The windows are staggered so that there will always be a corner visible."<br> <br> | allowedArea grid initialFrame otherFrames cornerSel corner delta putativeCorner free maxLevel |<br> <br>+ allowedArea :=(self maximumUsableAreaInWorld: aWorldOrNil)<br>- allowedArea :=(self maximumUsableAreaInWorld: aWorld)<br> insetBy: (self scrollBarSetback @ self screenTopSetback extent: 0@0).<br> "Number to be staggered at each corner (less on small screens)"<br> maxLevel := allowedArea area > 300000 ifTrue: [3] ifFalse: [2].<br> "Amount by which to stagger (less on small screens)"<br> grid := allowedArea area > 500000 ifTrue: [40] ifFalse: [20].<br> initialFrame := 0@0 extent: ((initialExtent<br> "min: (allowedArea extent - (grid*(maxLevel+1*2) + (grid//2))))<br> min: 600@400")).<br> otherFrames := Smalltalk isMorphic<br>+ ifTrue: [(SystemWindow windowsIn: aWorldOrNil satisfying: [:w | w isCollapsed not])<br>- ifTrue: [(SystemWindow windowsIn: aWorld satisfying: [:w | w isCollapsed not])<br> collect: [:w | w bounds]]<br> ifFalse: [ScheduledControllers scheduledWindowControllers<br> select: [:aController | aController view ~~ nil]<br> thenCollect: [:aController | aController view isCollapsed<br> ifTrue: [aController view expandedFrame]<br> ifFalse: [aController view displayBox]]].<br> 0 to: maxLevel do:<br> [:level | <br> 1 to: 4 do:<br> [:ci | cornerSel := #(topLeft topRight bottomRight bottomLeft) at: ci.<br> corner := allowedArea perform: cornerSel.<br> "The extra grid//2 in delta helps to keep title tabs distinct"<br> delta := (maxLevel-level*grid+(grid//2)) @ (level*grid).<br> 1 to: ci-1 do: [:i | delta := delta rotateBy: #right centerAt: 0@0]. "slow way"<br> putativeCorner := corner + delta.<br> free := true.<br> otherFrames do:<br> [:w |<br> free := free & ((w perform: cornerSel) ~= putativeCorner)].<br> free ifTrue:<br> [^ (initialFrame align: (initialFrame perform: cornerSel)<br> with: putativeCorner)<br> translatedAndSquishedToBeWithin: allowedArea]]].<br> "If all else fails..."<br> ^ (self scrollBarSetback @ self screenTopSetback extent: initialFrame extent)<br> translatedAndSquishedToBeWithin: allowedArea!<br><br><br></div></blockquote>
</div></body>