Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix rare crash, thanks to Enrique

  • Loading branch information...
commit aa826f31b24b266a03c2621d52b5d2898bde4817 1 parent 24f6001
@elan elan authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 xbmc/osx/CocoaUtils.m
View
15 xbmc/osx/CocoaUtils.m
@@ -233,7 +233,7 @@ static double getDictDouble(CFDictionaryRef refDict, CFStringRef key)
void Cocoa_GL_BlankOtherDisplays(int screen)
{
- int numDisplays = Cocoa_GetNumDisplays();
+ int numDisplays = [[NSScreen screens] count];
int i = 0;
// Blank.
@@ -246,13 +246,12 @@ void Cocoa_GL_BlankOtherDisplays(int screen)
NSRect screenRect = [pScreen frame];
// Build a blanking window.
- screenRect.origin.x = 0.0;
- screenRect.origin.y = 0.0;
+ screenRect.origin = NSZeroPoint;
blankingWindows[i] = [[NSWindow alloc] initWithContentRect:screenRect
- styleMask:NSBorderlessWindowMask
- backing:NSBackingStoreBuffered
- defer:NO
- screen:pScreen];
+ styleMask:NSBorderlessWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO
+ screen:pScreen];
[blankingWindows[i] setBackgroundColor:[NSColor blackColor]];
[blankingWindows[i] setLevel:CGShieldingWindowLevel()];
@@ -263,7 +262,7 @@ void Cocoa_GL_BlankOtherDisplays(int screen)
void Cocoa_GL_UnblankOtherDisplays(int screen)
{
- int numDisplays = Cocoa_GetNumDisplays();
+ int numDisplays = [[NSScreen screens] count];
int i = 0;
for (i=0; i<numDisplays; i++)
Please sign in to comment.
Something went wrong with that request. Please try again.