Fix setting the app window's title on osx

master
Cinders 2013-09-09 21:47:32 -06:00
parent 3241b67346
commit 22e2fa7859
3 changed files with 10 additions and 3 deletions

View File

@ -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); // <FS:CR> Set Window title
NSWindowRef createNSWindow(int x, int y, int width, int height);

View File

@ -450,3 +450,11 @@ unsigned int getModifiers()
{
return [NSEvent modifierFlags];
}
// <FS:CR> 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];
}
// </FS:CR>

View File

@ -1590,9 +1590,7 @@ void LLWindowMacOSX::hideCursorUntilMouseMove()
void LLWindowMacOSX::setTitle(const std::string &title)
{
// FIXME: 3.6.5 Merge <FS:CR>
//CFStringRef string = CFStringCreateWithCString(NULL, title.c_str(), kCFStringEncodingUTF8);
//SetWindowTitleWithCFString(mWindow, string);
setTitleCocoa(mWindow, title);
}
//