src/video/cocoa/SDL_cocoamodes.m
changeset 6788 036f53f2f5aa
parent 6787 95a4c5a5464c
child 6809 54cca01b6006
equal deleted inserted replaced
6787:95a4c5a5464c 6788:036f53f2f5aa
   218         CFRelease(modelist);  /* NULL is ok */
   218         CFRelease(modelist);  /* NULL is ok */
   219     }
   219     }
   220     #endif
   220     #endif
   221 }
   221 }
   222 
   222 
   223 static char *
   223 static const char *
   224 Cocoa_GetDisplayName(CGDirectDisplayID displayID)
   224 Cocoa_GetDisplayName(CGDirectDisplayID displayID)
   225 {
   225 {
   226     NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName);
   226     NSDictionary *deviceInfo = (NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName);
   227     NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
   227     NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
   228 
   228 
   297                 continue;
   297                 continue;
   298             }
   298             }
   299             displaydata->display = displays[i];
   299             displaydata->display = displays[i];
   300 
   300 
   301             SDL_zero(display);
   301             SDL_zero(display);
   302             display.name = Cocoa_GetDisplayName(displays[i]);
   302             display.name = (char *)Cocoa_GetDisplayName(displays[i]);
   303             if (!GetDisplayMode (_this, moderef, &mode)) {
   303             if (!GetDisplayMode (_this, moderef, &mode)) {
   304                 Cocoa_ReleaseDisplayMode(_this, moderef);
   304                 Cocoa_ReleaseDisplayMode(_this, moderef);
   305                 SDL_free(displaydata);
   305                 SDL_free(displaydata);
   306                 continue;
   306                 continue;
   307             }
   307             }