The Trunk: Morphic-mt.1763.mcz

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

The Trunk: Morphic-mt.1763.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1763.mcz

==================== Summary ====================

Name: Morphic-mt.1763
Author: mt
Time: 28 April 2021, 9:31:14.313168 am
UUID: 33370f53-b3b0-0b4a-8333-fe869808b435
Ancestors: Morphic-mt.1762

Fixes hpi-dpi bug for windows opened via #openModal: such as the FontChooserTool. The windows had the wrong extent.

=============== Diff against Morphic-mt.1762 ===============

Item was changed:
  ----- Method: Morph>>openModal: (in category 'polymorph') -----
  openModal: aSystemWindow
  "Open the given window locking the receiver until it is dismissed.
  Answer the system window.
  Restore the original keyboard focus when closed."
 
+ | hand priorFocus mySysWin |
+ mySysWin := self isSystemWindow
+ ifTrue: [ self ]
+ ifFalse: [ (self ownerThatIsA: SystemWindow) ifNil: [ self ] ].
+ hand := self currentHand.
+ priorFocus := hand keyboardFocus.
+ [ mySysWin modalLockTo: aSystemWindow.
+ ToolBuilder default runModal: aSystemWindow openAsIs ]
+ ensure:
+ [ mySysWin modalUnlockFrom: aSystemWindow.
+ hand newKeyboardFocus: priorFocus ].
- |area mySysWin keyboardFocus|
- keyboardFocus := self activeHand keyboardFocus.
- mySysWin := self isSystemWindow ifTrue: [self] ifFalse: [self ownerThatIsA: SystemWindow].
- mySysWin ifNil: [mySysWin := self].
- mySysWin modalLockTo: aSystemWindow.
- area := RealEstateAgent maximumUsableArea.
- aSystemWindow extent: aSystemWindow initialExtent.
- aSystemWindow position = (0@0)
- ifTrue: [aSystemWindow
- position: self activeHand position - (aSystemWindow extent // 2)].
- aSystemWindow
- bounds: (aSystemWindow bounds translatedToBeWithin: area).
- [ToolBuilder default runModal: aSystemWindow openAsIs]
- ensure: [mySysWin modalUnlockFrom: aSystemWindow.
- self activeHand newKeyboardFocus: keyboardFocus].
  ^aSystemWindow!