We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 844 - Cocoa video driver fails init when both displays are mirrored
Summary: Cocoa video driver fails init when both displays are mirrored
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Mac OS X (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-12 09:48 UTC by Sam Lantinga
Modified: 2009-12-03 00:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Lantinga 2009-10-12 09:48:08 UTC
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
Comment 1 Sam Lantinga 2009-12-03 00:59:35 UTC
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?
Comment 2 Sam Lantinga 2009-12-03 00:59:58 UTC
I believe this is fixed! :)