| Summary: | OSX: Exclusive fullscreen failure in CGDisplaySetDisplayMode happening in dota2 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Dan Ginsburg <dang> |
| Component: | video | Assignee: | Alex Szpakowski <amaranth72> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | ewasylishen |
| Version: | 2.0.6 | ||
| Hardware: | x86_64 | ||
| OS: | macOS 10.12 | ||
|
Description
Dan Ginsburg
2017-11-08 19:39:50 UTC
Alex, this is affecting DOTA 2, so we're going to back out the change until you have a chance to look at it. BTW here is a quick hacky bit of logging you can paste in Cocoa_GetDisplayModes to see what kCGDisplayShowDuplicateLowResolutionModes is doing on that machine / config:
{
NSLog(@"display modes for %s with kCGDisplayShowDuplicateLowResolutionModes set to true:", Cocoa_GetDisplayName(data->display));
for (id mode in (NSArray *)CGDisplayCopyAllDisplayModes(data->display, (CFDictionaryRef)@{(id)kCGDisplayShowDuplicateLowResolutionModes : (id)kCFBooleanTrue})) {
CGDisplayModeRef cgmode = (CGDisplayModeRef)mode;
NSLog(@" %dx%d points, %dx%d pixels @ %d Hz", (int)CGDisplayModeGetWidth(cgmode), (int)CGDisplayModeGetHeight(cgmode), (int)CGDisplayModeGetPixelWidth(cgmode), (int)CGDisplayModeGetPixelHeight(cgmode), (int)CGDisplayModeGetRefreshRate(cgmode));
}
NSLog(@"display modes for %s with no flags:", Cocoa_GetDisplayName(data->display));
for (id mode in (NSArray*)CGDisplayCopyAllDisplayModes(data->display, NULL)) {
CGDisplayModeRef cgmode = (CGDisplayModeRef)mode;
NSLog(@" %dx%d points, %dx%d pixels @ %d Hz", (int)CGDisplayModeGetWidth(cgmode), (int)CGDisplayModeGetHeight(cgmode), (int)CGDisplayModeGetPixelWidth(cgmode), (int)CGDisplayModeGetPixelHeight(cgmode), (int)CGDisplayModeGetRefreshRate(cgmode));
}
}
On my 15" retina macbook pro (2012) with nVidia graphics, setting kCGDisplayShowDuplicateLowResolutionModes to true causes "high DPI" display modes to show up in the list, e.g. "1920x1200 points, 3840x2400 pixels @ 0 Hz", otherwise all of the modes have equal points and pixels sizes.
It might also be worth checking the CGDisplayModeGetWidth and CGDisplayModeGetPixelWidth of the mode that causes CGDisplaySetDisplayMode to fail.
At first glance it seems like on the AMD machine, kCGDisplayShowDuplicateLowResolutionModes is causing some 1920x1080 points mode to be returned that can't actually be switched to.
I've applied an improved version of the original change that was backed out. This time it also falls back to the legacy codepath on macOS 10.12 and older: https://hg.libsdl.org/SDL/rev/d62dcbe19211 |