Commit 66fc1319 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Use the display unit number rather than display ID for the initial…

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: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent d8deecab
......@@ -187,7 +187,7 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID
size_t len;
WCHAR* buf = NULL;
snprintf(display_key_name, sizeof(display_key_name), "Display 0x%08x", displayID);
snprintf(display_key_name, sizeof(display_key_name), "Display 0x%08x", CGDisplayUnitNumber(displayID));
/* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */
if (RegCreateKeyExA(parent_hkey, display_key_name, 0, NULL,
REG_OPTION_VOLATILE, KEY_WRITE, NULL, &display_hkey, NULL))
......@@ -328,7 +328,7 @@ static struct display_mode_descriptor* create_original_display_mode_descriptor(C
init_original_display_mode();
snprintf(display_key, sizeof(display_key), display_key_format, displayID);
snprintf(display_key, sizeof(display_key), display_key_format, CGDisplayUnitNumber(displayID));
/* @@ Wine registry key: HKLM\Software\Wine\Mac Driver\Initial Display Mode\Display 0xnnnnnnnn */
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, display_key, 0, KEY_READ, &hkey))
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment