<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Eliot --<div><br></div><div>Please try again with the most recent OSVM and Squeak Trunk.</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 07.04.2022 09:34:27 schrieb Marcel Taeumel <marcel.taeumel@hpi.de>:</p><div style='font-family:Arial,Helvetica,sans-serif'><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Eliot --<div><br></div><div>The contract is to rely on the image side to poll both scale factor and screen size and react to changes. Everything is in place. Squeak can even detect for a changed platform scale factor whether the OS already did resize the window.</div><div><br></div><div>We just need to merge krono/highdpi-v2 which we are about to do. :-) Then, #actualScreenScaleFactor will be accessible from the image.</div><div><br></div><div>Until then, just change the scale factor manually in Squeak via Extras > Scale Factor.</div><div><br></div><div>Best,</div><div>Marcel</div><div><br></div><div>P.S.: As always, a purely event-driven system would be the way to go. However, we rely on polling for a changed screen size so we do as well for a changed platform scale factor (here on macOS: backing scale factor).</div><div><br></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;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 07.04.2022 06:31:40 schrieb Eliot Miranda <eliot.miranda@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif"> On Wed, Apr 6, 2022 at 9:21 PM Eliot Miranda <eliot.miranda@gmail.com>
<br>wrote:
<br>
<br>> Hi Marcel, Tobias, Ronie,
<br>>
<br>>     I'm using an M1 laptop with a retina display (RD), which has a pixel
<br>> extent of 3456@2234 and a scale factor of 2, hence giving an effective
<br>> extent of 1728@1117.  I have a now old Cinema DIsplay (CD) attached,
<br>> which has a pixel extent of 2560@1440 and a scale factor of 1.  When
<br>> either the image opens on the CD, or is dragged from the RD to the CD, it
<br>> ends up half the desired Smalltalk extent (the one saved in the image
<br>> header, used to set the screen size form within Squeak etc).
<br>>
<br>> If I comment out the line sending convertRectFromBacking:
<br>> in platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m::setupWindow it no longer
<br>> does this:
<br>>
<br>>     NSRect resetFrame;
<br>>     resetFrame.origin.x = 0.0f;
<br>>     resetFrame.origin.y = 0.0f;
<br>>     resetFrame.size.width = width;
<br>>     resetFrame.size.height = height;
<br>> #if 0 // Doing this results in a half sized window on a retina display with
<br>>     // a backingScalefactor of two
<br>>     resetFrame = [[self mainView] convertRectFromBacking: resetFrame];
<br>> #endif
<br>>
<br>>     NSSize sizeOfWindowContent = resetFrame.size;
<br>>     [gDelegateApp.window setContentSize: sizeOfWindowContent];
<br>>
<br>> Clearly this is the wrong thing to do.  But something similar needs to
<br>> happen when dragging a window from on display to another that
<br>> have different scale factors.
<br>>
<br>> My question is where does this happen, or perhaps where should this
<br>> happen?  Presumably it's somewhere in the event handling code that allows
<br>> the window to be moved.
<br>>
<br>
<br>I've found this.  The iOS code doesn't listen for
<br>thewindowDidChangeBackingProperties: notification.  Where do we plum this
<br>in?
<br>
<br>https://developer.apple.com/documentation/appkit/nswindowdelegate/1419517-windowdidchangebackingproperties?language=objc
<br>
<br>> _,,,^..^,,,_
<br>> best, Eliot
<br>>
<br>
<br>
<br>-- 
<br>_,,,^..^,,,_
<br>best, Eliot
<br><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size: 10pt"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 6, 2022 at 9:21 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left-width: 1px;border-left-style: solid;border-left-color: rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div dir="ltr"><div style="font-size: 10pt">Hi Marcel, Tobias, Ronie,</div><div style="font-size: 10pt"><br></div><div style="font-size: 10pt">    I'm using an M1 laptop with a retina display (RD), which has a pixel extent of 3456@2234 and a scale factor of 2, hence giving an effective extent of 1728@1117.  I have a now old Cinema DIsplay (CD) attached, which has a pixel extent of 2560@1440 and a scale factor of 1.  When either the image opens on the CD, or is dragged from the RD to the CD, it ends up half the desired Smalltalk extent (the one saved in the image header, used to set the screen size form within Squeak etc).</div><div style="font-size: 10pt"><br></div><div style="font-size: 10pt">If I comment out the line sending convertRectFromBacking: in platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m::setupWindow it no longer does this:</div><div style="font-size: 10pt"><br></div><div style="font-size: 10pt">    NSRect resetFrame;<br>    resetFrame.origin.x = 0.0f;<br>    resetFrame.origin.y = 0.0f;<br>    resetFrame.size.width = width;<br>    resetFrame.size.height = height;<br>#if 0 // Doing this results in a half sized window on a retina display with<br>    // a backingScalefactor of two<br>    resetFrame = [[self mainView] convertRectFromBacking: resetFrame];<br>#endif<br><br>    NSSize sizeOfWindowContent = resetFrame.size;<br>    [gDelegateApp.window setContentSize: sizeOfWindowContent];<br></div><div style="font-size: 10pt"><br></div><div style="font-size: 10pt">Clearly this is the wrong thing to do.  But something similar needs to happen when dragging a window from on display to another that have different scale factors.</div><div style="font-size: 10pt"><br></div><div style="font-size: 10pt">My question is where does this happen, or perhaps where should this happen?  Presumably it's somewhere in the event handling code that allows the window to be moved.</div></div></blockquote><div><br></div><div class="gmail_default" style="font-size: 10pt">I've found this.  The iOS code doesn't listen for thewindowDidChangeBackingProperties: notification.  Where do we plum this in?</div><div class="gmail_default" style="font-size: 10pt"><br></div><div class="gmail_default" style="font-size: 10pt"><a href="https://developer.apple.com/documentation/appkit/nswindowdelegate/1419517-windowdidchangebackingproperties?language=objc">https://developer.apple.com/documentation/appkit/nswindowdelegate/1419517-windowdidchangebackingproperties?language=objc</a></div><div class="gmail_default" style="font-size: 10pt"></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex;border-left-width: 1px;border-left-style: solid;border-left-color: rgb(204,204,204);padding-left: 1ex;min-width: 500px"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-size: 10pt;border-collapse: separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>
<br></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size: 10pt;border-collapse: separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>
<br></eliot.miranda@gmail.com></div></blockquote></div></div></blockquote>
                                        </div></body>