From 22e2fa7859c7eb9c9d1ad1b7edd4e466578c4f1a Mon Sep 17 00:00:00 2001 From: Cinders Date: Mon, 9 Sep 2013 21:47:32 -0600 Subject: [PATCH] Fix setting the app window's title on osx --- indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx-objc.mm | 8 ++++++++ indra/llwindow/llwindowmacosx.cpp | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 32b3bfb078..8e0b4a91a8 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -70,6 +70,7 @@ void showNSCursor(); void hideNSCursorTillMove(bool hide); void requestUserAttention(); long showAlert(std::string title, std::string text, int type); +void setTitleCocoa(NSWindowRef window, const std::string &title); // Set Window title NSWindowRef createNSWindow(int x, int y, int width, int height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 0354c2b717..729f359c06 100755 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -450,3 +450,11 @@ unsigned int getModifiers() { return [NSEvent modifierFlags]; } + +// Set Window Title - sigh. +void setTitleCocoa(NSWindowRef window, const std::string &title) +{ + NSString *str = [NSString stringWithCString:title.c_str() encoding:[NSString defaultCStringEncoding]]; + [(LLNSWindow*)window setTitle:str]; +} +// diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 017e3f8cd2..29c1334ff9 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1590,9 +1590,7 @@ void LLWindowMacOSX::hideCursorUntilMouseMove() void LLWindowMacOSX::setTitle(const std::string &title) { - // FIXME: 3.6.5 Merge - //CFStringRef string = CFStringCreateWithCString(NULL, title.c_str(), kCFStringEncodingUTF8); - //SetWindowTitleWithCFString(mWindow, string); + setTitleCocoa(mWindow, title); } //