[Vm-dev] multiple monitors with different backingScaleFactors on MacOS X

Eliot Miranda eliot.miranda at gmail.com
Thu Apr 7 04:31:13 UTC 2022

On Wed, Apr 6, 2022 at 9:21 PM Eliot Miranda <eliot.miranda at gmail.com>

> Hi Marcel, Tobias, Ronie,
>     I'm using an M1 laptop with a retina display (RD), which has a pixel
> extent of 3456 at 2234 and a scale factor of 2, hence giving an effective
> extent of 1728 at 1117.  I have a now old Cinema DIsplay (CD) attached,
> which has a pixel extent of 2560 at 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).
> If I comment out the line sending convertRectFromBacking:
> in platforms/iOS/vm/OSX/SqueakOSXAppDelegate.m::setupWindow it no longer
> does this:
>     NSRect resetFrame;
>     resetFrame.origin.x = 0.0f;
>     resetFrame.origin.y = 0.0f;
>     resetFrame.size.width = width;
>     resetFrame.size.height = height;
> #if 0 // Doing this results in a half sized window on a retina display with
>     // a backingScalefactor of two
>     resetFrame = [[self mainView] convertRectFromBacking: resetFrame];
> #endif
>     NSSize sizeOfWindowContent = resetFrame.size;
>     [gDelegateApp.window setContentSize: sizeOfWindowContent];
> 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.
> 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.

I've found this.  The iOS code doesn't listen for
thewindowDidChangeBackingProperties: notification.  Where do we plum this


> _,,,^..^,,,_
> best, Eliot

best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220406/ff699cf6/attachment-0001.html>

More information about the Vm-dev mailing list