Commit Graph

15 Commits

Author SHA1 Message Date
Michael Stefaniuc d94de38f45 winemac.drv: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 08:51:50 +02:00
Ken Thomases 1c94bf396f winemac: Add support for a high-resolution ("Retina") rendering mode.
When this Retina mode is enabled and the primary display is in the user's
default configuration, Wine gets told that screen and window sizes and mouse
coordinates are twice what Cocoa reports them as in its virtual coordinate
system ("points").  The Windows apps then renders at that high resolution and
the Mac driver blits it to screen.  If the screen is actually a Retina display
in a high-DPI mode, then this extra detail will be preserved.  Otherwise, the
rendering will be downsampled and blurry.

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.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-06 11:45:24 +09:00
Ken Thomases 66fc13197b winemac: Use the display unit number rather than display ID for the initial display mode registry key.
On Macs with dual GPUs that automatically switch, the display ID is not stable.
It changes when the active GPU changes.  The resulted in the lookup of the
initial display mode failing and games not being able to restore it properly.

The display unit number should be more reliable, although still not perfect.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-17 22:56:40 +09:00
Ken Thomases dbb0bacf67 winemac: Fix how the user's default display mode is determined.
The code had been checking the kDisplayModeDefaultFlag in the mode's IOFlags,
but that doesn't do what I thought.  That indicates which mode the driver
considers to be the default for the hardware.  It turns out there's no way to
query the user's default mode.

So, at the first opportunity during a given Wine session, the Mac driver
queries the current display mode and assumes that's the user's default mode.
It records that in a volatile registry key for use by subsequent processes
during that same session.

This doesn't use the existing registry key under
HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Video that records the
mode when CDS_UPDATEREGISTRY is used with ChangeDisplaySettingsEx() -- which
explorer.exe does during start-up -- because a) that doesn't support the
distinction between pixel size and point size for Retina modes, and b) in
theory, apps could overwrite that.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-27 21:43:31 +09:00
Ken Thomases 02c6676864 winemac: Reorganize copy_display_modes() to clarify that the user's default mode is always included.
Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-27 21:43:27 +09:00
Ken Thomases c3d7f5b7ec winemac: Use new API when available to list all display modes available on Retina Macs. 2014-07-30 11:33:00 -05:00
Ken Thomases c072a4564e winemac: For ChangeDisplaySettingsEx(), if caller didn't specify, prefer non-interlaced and unstretched modes. 2014-01-10 12:05:45 +01:00
Ken Thomases 4f23821f08 winemac: Add registry setting to control setting display gamma ramp. 2013-07-09 10:28:43 +02:00
Ken Thomases 5c8d6a0b93 winemac: Synthesize 8- and 16-bpp display modes if the system doesn't provide any.
macdrv_ChangeDisplaySettingsEx() ignores the requested bpp, anyway, so we
can report any values we think programs will want.
2013-03-28 12:18:51 +01:00
Ken Thomases e633f79f61 winemac: Implement GetDeviceGammaRamp() and SetDeviceGammaRamp(). 2013-03-26 12:07:03 +01:00
Ken Thomases d26a6bf451 winemac: Implement ChangeDisplaySettingsEx(). 2013-02-18 10:35:46 +01:00
Ken Thomases 4f4ac0cafc winemac: Implement EnumDisplaySettingsEx(). 2013-02-18 10:35:35 +01:00
Ken Thomases bc75a9baff winemac: Implement DISPLAYS_CHANGED event for when display configuration has changed. 2013-02-18 10:34:55 +01:00
Ken Thomases d8a0da9d8f winemac.drv: Implement GetMonitorInfo. 2012-12-26 18:23:03 +01:00
Ken Thomases 21c4fc3326 winemac.drv: Implement EnumDisplayMonitors. 2012-12-26 18:23:03 +01:00