Only grab the main display when going full screen. You cannot really interact with the other screens while in full screen, but you can at least see them.

This commit is contained in:
Steve Checkoway
2008-12-23 02:40:26 +00:00
parent cdb4c81f0a
commit 902169718f
2 changed files with 10 additions and 4 deletions
@@ -3,9 +3,12 @@
#include "LowLevelWindow.h"
#include "RageDisplay.h"
#include <objc/objc.h>
typedef struct objc_object *id;
typedef const struct __CFDictionary *CFDictionaryRef;
/* XXX: This was changed to a uint32_t later and its header file cannot be included
* since Style conflicts. Ugh. */
typedef struct _CGDirectDisplayID *CGDirectDisplayID;
class LowLevelWindow_MacOSX : public LowLevelWindow
{
@@ -14,6 +17,7 @@ class LowLevelWindow_MacOSX : public LowLevelWindow
id m_Context;
id m_BGContext;
CFDictionaryRef m_CurrentDisplayMode;
CGDirectDisplayID m_DisplayID;
public:
LowLevelWindow_MacOSX();
@@ -287,7 +287,8 @@ void RenderTarget_MacOSX::FinishRenderingTo()
m_OldContext = nil;
}
LowLevelWindow_MacOSX::LowLevelWindow_MacOSX() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL)
LowLevelWindow_MacOSX::LowLevelWindow_MacOSX() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL), m_DisplayID(0)
{
POOL;
m_WindowDelegate = [[SMWindowDelegate alloc] init];
@@ -453,7 +454,7 @@ void LowLevelWindow_MacOSX::ShutDownFullScreen()
ASSERT( err == kCGErrorSuccess );
CGDisplayShowCursor( kCGDirectMainDisplay );
err = CGReleaseAllDisplays();
err = CGDisplayRelease( m_DisplayID );
ASSERT( err == kCGErrorSuccess );
SetActualParamsFromMode( m_CurrentDisplayMode );
// We don't own this so we cannot release it.
@@ -469,7 +470,8 @@ int LowLevelWindow_MacOSX::ChangeDisplayMode( const VideoModeParams& p )
if( !m_CurrentDisplayMode )
{
if( (err = CGCaptureAllDisplays()) != kCGErrorSuccess )
m_DisplayID = CGMainDisplayID();
if( (err = CGDisplayCapture(m_DisplayID)) != kCGErrorSuccess )
return err;
// Only hide the first time we go to full screen.
CGDisplayHideCursor( kCGDirectMainDisplay );