src/video/cocoa/SDL_cocoawindow.m
changeset 9797 c142db5785ad
parent 9796 e0db4fedf80c
child 9841 aa1321ce8425
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 04 21:04:49 2015 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Jul 05 15:45:48 2015 -0700
     1.3 @@ -1241,8 +1241,9 @@
     1.4  Cocoa_SetWindowTitle(_THIS, SDL_Window * window)
     1.5  { @autoreleasepool
     1.6  {
     1.7 +    const char *title = window->title ? window->title : "";
     1.8      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
     1.9 -    NSString *string = [[NSString alloc] initWithUTF8String:window->title];
    1.10 +    NSString *string = [[NSString alloc] initWithUTF8String:title];
    1.11      [nswindow setTitle:string];
    1.12      [string release];
    1.13  }}
    1.14 @@ -1428,7 +1429,7 @@
    1.15  { @autoreleasepool
    1.16  {
    1.17      if (SetWindowStyle(window, GetWindowStyle(window))) {
    1.18 -        if (bordered && window->title) {
    1.19 +        if (bordered) {
    1.20              Cocoa_SetWindowTitle(_this, window);  /* this got blanked out. */
    1.21          }
    1.22      }
    1.23 @@ -1499,7 +1500,7 @@
    1.24      s_moveHack = SDL_GetTicks();
    1.25  
    1.26      /* When the window style changes the title is cleared */
    1.27 -    if (!fullscreen && window->title) {
    1.28 +    if (!fullscreen) {
    1.29          Cocoa_SetWindowTitle(_this, window);
    1.30      }
    1.31