diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index a15332e2f..48264ef47 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -171,6 +171,8 @@ public: // Provide native key event data virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); } + virtual void setTitle(const std::string &title){}; + protected: LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags); virtual ~LLWindow(); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 34f52701a..e83425a79 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -3272,6 +3272,15 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) } } +void LLWindowMacOSX::setTitle(const std::string &title) +{ + /*strncpy((char*)mWindowTitle + 1, title.c_str(), 253); + mWindowTitle[0] = title.length();*/ + + CFStringRef title_str = CFStringCreateWithCString(NULL, title.c_str(), kCFStringEncodingUTF8); + SetWindowTitleWithCFString(mWindow, title_str); +} + LLSD LLWindowMacOSX::getNativeKeyData() { LLSD result = LLSD::emptyMap(); diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 504b446d1..3096a0aec 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -118,6 +118,8 @@ public: /*virtual*/ void interruptLanguageTextInput(); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + /*virtual*/ void setTitle(const std::string &title); + static std::vector getDynamicFallbackFontList(); // Provide native key event data diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index d600df17f..b87cb21a7 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2514,6 +2514,11 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) llinfos << "spawn_web_browser returning." << llendl; } +void LLWindowSDL::setTitle(const std::string &title) +{ + mWindowTitle = title; + SDL_WM_SetCaption(mWindowTitle.c_str(),mWindowTitle.c_str()); +} void *LLWindowSDL::getPlatformWindow() { diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index a6b9ff4f9..4fbe89b5e 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -127,6 +127,8 @@ public: /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + /*virtual*/ void setTitle(const std::string &title); + static std::vector getDynamicFallbackFontList(); // Not great that these are public, but they have to be accessible diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index d73fb3a0a..8fecd08d3 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3140,6 +3140,14 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url, bool async) ShellExecuteEx( &sei ); } +void LLWindowWin32::setTitle(const std::string &title) +{ + mbstowcs(mWindowTitle, title.c_str(), 255); + mWindowTitle[255] = 0; + + SetWindowText(mWindowHandle, mWindowTitle); +} + /* Make the raw keyboard data available - used to poke through to LLQtWebKit so that Qt/Webkit has access to the virtual keycodes etc. that it needs diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 9343593f6..fefe5d308 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -117,6 +117,8 @@ public: void ShellEx(const std::string& command); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + /*virtual*/ void setTitle(const std::string &title); + LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); static std::vector getDynamicFallbackFontList(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7372023e0..9ebce0906 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1886,6 +1886,12 @@ bool idle_startup() // OGPX : Inventory root might be null in OGP. // && gAgent.mInventoryRootID.notNull()) { + std::string name = firstname; + std::string last_name = lastname; + LLStringUtil::toLower(last_name); + if(last_name != "resident") + name += " " + lastname; + gViewerWindow->getWindow()->setTitle(LLAppViewer::instance()->getWindowTitle() + "- " + name); LLStartUp::setStartupState( STATE_WORLD_INIT ); } else