diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindow.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 14 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 9 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.h | 2 |
7 files changed, 20 insertions, 13 deletions
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 55b221e716..52132c38d3 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -160,7 +160,7 @@ public: virtual void setLanguageTextInput( const LLCoordGL & pos ) {}; virtual void updateLanguageTextInputArea() {} virtual void interruptLanguageTextInput() {} - virtual void spawnWebBrowser(const std::string& escaped_url) {}; + virtual void spawnWebBrowser(const std::string& escaped_url, bool async) {}; static std::vector<std::string> getDynamicFallbackFontList(); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 022b97f481..7026a3f7a6 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -3178,7 +3178,7 @@ S32 OSMessageBoxMacOSX(const std::string& text, const std::string& caption, U32 // Open a URL with the user's default web browser. // Must begin with protocol identifier. -void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url) +void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) { bool found = false; S32 i; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7c6b324029..5ac74bb004 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -116,7 +116,7 @@ public: /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); /*virtual*/ void interruptLanguageTextInput(); - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); + /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); static std::vector<std::string> getDynamicFallbackFontList(); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 1f705f9e60..4d25b4134e 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2465,7 +2465,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg) // Open a URL with the user's default web browser. // Must begin with protocol identifier. -void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url) +void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) { llinfos << "spawn_web_browser: " << escaped_url << llendl; @@ -2543,6 +2543,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList() // Use libfontconfig to find us a nice ordered list of fallback fonts // specific to this system. std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf"); + const int max_font_count_cutoff = 40; // fonts are expensive in the current system, don't enumerate an arbitrary number of them // Our 'ideal' font properties which define the sorting results. // slant=0 means Roman, index=0 means the first face in a font file // (the one we actually use), weight=80 means medium weight, @@ -2558,7 +2559,6 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList() std::vector<std::string> rtns; FcFontSet *fs = NULL; FcPattern *sortpat = NULL; - int font_count = 0; llinfos << "Getting system font list from FontConfig..." << llendl; @@ -2602,12 +2602,13 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList() FcPatternDestroy(sortpat); } + int found_font_count = 0; if (fs) { // Get the full pathnames to the fonts, where available, // which is what we really want. - int i; - for (i=0; i<fs->nfont; ++i) + found_font_count = fs->nfont; + for (int i=0; i<fs->nfont; ++i) { FcChar8 *filename; if (FcResultMatch == FcPatternGetString(fs->fonts[i], @@ -2616,7 +2617,8 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList() && filename) { rtns.push_back(std::string((const char*)filename)); - ++font_count; + if (rtns.size() >= max_font_count_cutoff) + break; // hit limit } } FcFontSetDestroy (fs); @@ -2629,7 +2631,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList() { lldebugs << " file: " << *it << llendl; } - llinfos << "Using " << font_count << " system font(s)." << llendl; + llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl; rtns.push_back(final_fallback); return rtns; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index e6bdd46a77..8e65a2f324 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -125,7 +125,7 @@ public: /*virtual*/ void *getPlatformWindow(); /*virtual*/ void bringToFront(); - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); + /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); static std::vector<std::string> getDynamicFallbackFontList(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 8df9dad581..d726c60018 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -2959,7 +2959,7 @@ S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 t } -void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url ) +void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url, bool async) { bool found = false; S32 i; @@ -2989,7 +2989,12 @@ void LLWindowWin32::spawnWebBrowser(const std::string& escaped_url ) // let the OS decide what to use to open the URL SHELLEXECUTEINFO sei = { sizeof( sei ) }; - sei.fMask = SEE_MASK_FLAG_DDEWAIT; + // NOTE: this assumes that SL will stick around long enough to complete the DDE message exchange + // necessary for ShellExecuteEx to complete + if (async) + { + sei.fMask = SEE_MASK_ASYNCOK; + } sei.nShow = SW_SHOWNORMAL; sei.lpVerb = L"open"; sei.lpFile = url_utf16.c_str(); diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 9d57735772..d4a3446515 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -114,7 +114,7 @@ public: /*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ); /*virtual*/ void updateLanguageTextInputArea(); /*virtual*/ void interruptLanguageTextInput(); - /*virtual*/ void spawnWebBrowser(const std::string& escaped_url); + /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); LLWindowCallbacks::DragNDropResult completeDragNDropRequest( const LLCoordGL gl_coord, const MASK mask, LLWindowCallbacks::DragNDropAction action, const std::string url ); |