| Summary: | Cocoa video driver fails init when both displays are mirrored | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sam Lantinga <slouken> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Mac OS X (All) | ||
I think this is fixed in the latest SDL 1.3 snapshot: http://www.libsdl.org/tmp/SDL-1.3.zip Can you give it a try and let me know if this is fixed? I believe this is fixed! :) |
In the most current svn version of SDL 1.3, SDL_Init() will fail if you're running OSX with a pair of displays in mirror mode. Specifically, SDL_cocoamodes.m contains the following snippet in Cocoa_InitModes(): if (CGDisplayIsInMirrorSet(displays[i])) { continue; } This isn't correct. If all displays are in the mirror set, then no displays will ultimately be added. The first display in each particular mirror set must be added to the display list. Locally, I've changed this to be: if (i!=0 && CGDisplayIsInMirrorSet(displays[i])) { continue; } This works for the simple case where there are two displays, both of which are mirrored. This will fail if display [0] isn't mirrored, but displays [1] and [2] are. Could somebody with more familiarity with cocoa mirror sets suggest a better patch, one that detects if a given display is the first in its mirror set? -Chris