[Vm-dev] HiDpi support in MacOS

Marcel Taeumel marcel.taeumel at hpi.de
Thu Apr 28 10:40:41 UTC 2022


Hi Steffen --

That depends on how Pharo's OSVM fork [1] currently talks to the platform in this regard. For example, if it is basically SDL2-via-FFI or SDL2-via-VM, then you could read about the HighDPI support of SDL2 regarding various platforms. I think it is SDL2-via-FFI. Maybe there is something on Stackoverflow?

>From the original OSVM sources, you can learn about how to talk to macOS' CoreGraphics or Metal directly:
 - https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/Common/Classes/sqSqueakScreenAndWindow.m

 - https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m
 - https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXCGView.m

Hope this helps.

Best,
Marcel

[1] https://github.com/pharo-project/opensmalltalk-vm
Am 28.04.2022 11:17:30 schrieb Steffen Märcker <merkste at web.de>:
Is there a way
to take advantage of that VM-change to enhance sharpness in Pharo 10
already on MacBook retina displays? 

Kind regards,
Steffen



Marcel Taeumel schrieb am
Donnerstag, 28. April 2022 10:18:46 (+02:00):



style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left:
1ex">

Hi all --

I
documented this
here: https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/628

Best,
Marcel

class="mb_sig">

style="padding-left:10px;margin-left:0px;margin-top:20px;border-left-width:1px;border-bottom-width:1px;border-right-width:1px;border-top-width:1px;border-left-style:solid;">


Am 28.04.2022 09:51:22
schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:

style="font-family:Arial, Helvetica, sans-serif;">

id="__MailbirdStyleContent" style="text-align:left;color:rgb(0, 0,
0);font-family:Arial;font-size:10pt;" dir="ltr">
Hi Juan
--

Currently, we only use the backingScaleFactor. For
current systems this can only ever be 1.0 or 2.0. I have yet to discover
the macOS API that let's us work with native pixels for that other (older)
form other scaling on macOS.

I will open an issue
for that.

Best,
Marcel

class="mb_sig">


class="history_container" type="cite"
style="min-width:500px;padding-left:10px;margin-left:0px;margin-top:20px;border-left-width:1px;border-bottom-width:1px;border-right-width:1px;border-top-width:1px;border-left-style:solid;">


Am 28.04.2022 00:39:12
schrieb Juan Vuletich <juanvuletich at zoho.com>:

style="font-family:Arial, Helvetica, sans-serif;">Hi Folks,



I just discovered that the recent 202204190959 Mac VM includes Tobias

HiDpi support on the Mac. This is very good news indeed, but It is not

exactly what most users would prefer.



On a Retina MacBook, you can set an apparent display resolution (System


Preferences.../ Displays). By default, my 2019 15" MBP suggest half

"real" resolution ("Looks like 1440x900" when LCD is 2880x1800). In
this

case, the new VM offers the true native resolution to Cuis / Squeak.
So,

in this case, it works perfectly well, and everything looks really
great.



The problem is that MacOs supports several other apparent resolutions.

Many people, me included, prefer "Looks like 1680x1050" or "Looks like

1920x1200") to have more room for other Mac apps. But in these cases,

the VM doesn't offer the LCD native resolution to Cuis / Squeak
anymore.

It offers twice the apparent resolution, i.e. 3360x2100 or 3840x2400.

Then MacOs scales this higher virtual resolution to the actual

2880x1800, but it generates visual artifacts and a decrease in visual

quality.



For my own private use, the solution is to use the EasyRes application,


and set the display to the true 2880x1800 resolution. When I do this,

Cuis gets the corrrect Display size both with previous and newer VMs.



But it would be great if there was a way for other Cuis / Squeak users

to get their true Display resolution by default, and without needing to


change OS settings each time they start their favorite Smalltalk.



Thanks,



--

Juan Vuletich

www.cuis-smalltalk.org

https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev

https://github.com/jvuletich

https://www.linkedin.com/in/juan-vuletich-75611b3

https://independent.academia.edu/JuanVuletich

https://www.researchgate.net/profile/Juan-Vuletich

https://patents.justia.com/inventor/juan-manuel-vuletich

https://twitter.com/JuanVuletich





class="viv-signature-below">
-- 
Gesendet mit Vivaldi Mail.
Laden Sie Vivaldi kostenlos von vivaldi.com
herunter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20220428/9e3ac0bb/attachment-0001.html>


More information about the Vm-dev mailing list