[PATCH] winemac: Add support for a high-resolution ("Retina") rendering mode.

Ken Thomases ken at codeweavers.com
Fri May 6 08:46:37 CDT 2016


Hi Jacek,

On May 6, 2016, at 5:09 AM, Jacek Caban <jacek at codeweavers.com> wrote:
> 
> On 05/05/16 20:53, Ken Thomases wrote:
>> This is intended to be combined with increasing the Windows DPI, as via winecfg.
>> If that is doubled to 192, then, in theory, graphical elements will remain the
>> same visual size on screen but be rendered with finer detail.  Unfortunately,
>> many Windows programs don't correctly handle non-standard DPI so the results
>> are not always perfect.
>> 
>> The registry setting to enable Retina mode is:
>> 
>> [HKEY_CURRENT_USER\Software\Wine\Mac Driver]
>> "RetinaMode"="y"
>> 
>> Note that this setting is not looked for in the AppDefaults\<exe name> key
>> because it doesn't make sense for only some processes in a Wine session to see
>> the high-resolution sizes and coordinates.
> 
> Would it make sense to follow what Windows does in this case? Something
> like SetProcessDPIAware and manifest support feels related.

Well, Wine should eventually support Win8.1+ DPI scaling, but that's a huge job.  The problem is DPI virtualization.  Per-monitor-DPI-aware apps see the real pixel sizes of everything and the real DPI of the displays. DPI-unaware apps and, in some cases, system-DPI-aware apps will see virtualized sizes and DPI.  Since all kinds of apps can be running at the same time, Wine would have to do a lot of conversions.  For example, one app can query the position of another app's window and would get a different result than that app would get for itself.  Any message that carries coordinate-system information would have to be scaled depending on the DPI-awareness of the recipient process.  Etc.

This patch is sort of the opposite.  With the way the Mac APIs work, current Wine behaves as though all apps are DPI-unaware and get the virtualized view of everything.  The system automatically pixel-doubles their rendering to show them at the expected visual size.  This patch actually goes back to the Win XP way, before DPI virtualization and automatic scaling.  The apps see the "true" pixel sizes and one has to change the DPI setting to get them to draw themselves bigger.  (I put "true" in quotes because I've really just chosen a different lie to tell them.  When RetinaMode is enabled, the Mac driver tells Wine that the display is twice its Cocoa size even if the display isn't a scaled Retina display.)

In other words, my patch makes Wine behave more like what you would get if you attached a 5K display to a Win XP machine.  The apps see the 5K display size and, by default, draw really teeny-tiny because the screen's pixels are teeny-tiny.  You have to crank up the DPI to get them to display at a more reasonable size.

Thanks,
Ken




More information about the wine-devel mailing list