winemac: Fix how the user's default display mode is determined.
commitdbb0bacf6731304f074f492438982949449a5266
authorKen Thomases <ken@codeweavers.com>
Tue, 27 Oct 2015 04:39:06 +0000 (26 23:39 -0500)
committerAlexandre Julliard <julliard@winehq.org>
Tue, 27 Oct 2015 12:43:31 +0000 (27 21:43 +0900)
tree1f7db011d6285a504fb01538f56d8604ec27adf7
parent02c6676864b0af2f0d6c999aec66c9bcba9b0a15
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>
dlls/winemac.drv/display.c