diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 1ef468fa7c14e7a5437e806bbae8d5b31ff65fe4..a945515dd64f28158b874472755f26d708e3419e 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -41,6 +41,7 @@ #include "lldir.h" #include "llfindlocale.h" +#include <SDL_misc.h> #if LL_GTK extern "C" { @@ -2507,39 +2508,6 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) } #endif // LL_GTK -#if LL_LINUX -// extracted from spawnWebBrowser for clarity and to eliminate -// compiler confusion regarding close(int fd) vs. LLWindow::close() -void exec_cmd(const std::string& cmd, const std::string& arg) -{ - char* const argv[] = {(char*)cmd.c_str(), (char*)arg.c_str(), NULL}; - fflush(NULL); - pid_t pid = fork(); - if (pid == 0) - { // child - // disconnect from stdin/stdout/stderr, or child will - // keep our output pipe undesirably alive if it outlives us. - close(0); - close(1); - close(2); - // end ourself by running the command - execv(cmd.c_str(), argv); /* Flawfinder: ignore */ - // if execv returns at all, there was a problem. - LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL; - _exit(1); // _exit because we don't want atexit() clean-up! - } else { - if (pid > 0) - { - // parent - wait for child to die - int childExitStatus; - waitpid(pid, &childExitStatus, 0); - } else { - LL_WARNS() << "fork failure." << LL_ENDL; - } - } -} -#endif - // Open a URL with the user's default web browser. // Must begin with protocol identifier. void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) @@ -2563,24 +2531,10 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async) LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL; -#if LL_LINUX -# if LL_X11 - if (mSDL_Display) + if (SDL_OpenURL(escaped_url.c_str()) != 0) { - // Just in case - before forking. - XSync(mSDL_Display, False); + LL_WARNS() << "spawn_web_browser failed with error: " << SDL_GetError() << LL_ENDL; } -# endif // LL_X11 - - std::string cmd, arg; - cmd = gDirUtilp->getAppRODataDir(); - cmd += gDirUtilp->getDirDelimiter(); - cmd += "etc"; - cmd += gDirUtilp->getDirDelimiter(); - cmd += "launch_url.sh"; - arg = escaped_url; - exec_cmd(cmd, arg); -#endif // LL_LINUX LL_INFOS() << "spawn_web_browser returning." << LL_ENDL; } diff --git a/indra/newview/linux_tools/client-readme.txt b/indra/newview/linux_tools/client-readme.txt index bbd1c8619eda27d5703d99d92ee018d84b1d86d8..80c3eed16354e0e18a1e1235f9fbd6d82d95a95f 100644 --- a/indra/newview/linux_tools/client-readme.txt +++ b/indra/newview/linux_tools/client-readme.txt @@ -1,4 +1,4 @@ -Second Life - Linux Beta README +Alchemy - Linux Beta README -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This document contains information about the Alchemy Viewer Linux diff --git a/indra/newview/linux_tools/launch_url.sh b/indra/newview/linux_tools/launch_url.sh deleted file mode 100755 index dd9da3a51c17793955b8005f5da7bdc45e0aa30d..0000000000000000000000000000000000000000 --- a/indra/newview/linux_tools/launch_url.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# This script loads a web page in the 'default' graphical web browser. -# It MUST return immediately (or soon), so the browser should be -# launched in the background (thus no text-only browsers). -# This script does not trust the URL to be well-escaped or shell-safe. -# -# On Unixoids we try, in order of decreasing priority: -# - $BROWSER if set (preferred) -# - Default GNOME browser -# - Default KDE browser -# - x-www-browser -# - The first browser in $BROWSER_COMMANDS that is found. - -URL="$1" - -if [ -z "$URL" ]; then - echo "Usage: $(basename "$0") URL" - exit -fi - -# restore LD_LIBRARY_PATH from SAVED_LD_LIBRARY_PATH if it exists -if [ "${SAVED_LD_LIBRARY_PATH+isset}" = "isset" ]; then - export LD_LIBRARY_PATH="${SAVED_LD_LIBRARY_PATH}" - echo "$0: Restored library path to '${SAVED_LD_LIBRARY_PATH}'" -fi - -# if $BROWSER is defined, use it. -XBROWSER=`echo "$BROWSER" |cut -f1 -d:` -if [ ! -z "$XBROWSER" ]; then - XBROWSER_CMD=`echo "$XBROWSER" |cut -f1 -d' '` - # look for $XBROWSER_CMD either literally or in PATH - if [ -x "$XBROWSER_CMD" ] || which $XBROWSER_CMD >/dev/null; then - # check for %s string, avoiding bash2-ism of [[ ]] - if echo "$XBROWSER" | grep %s >/dev/null; then - # $XBROWSER has %s which needs substituting - echo "$URL" | xargs -r -i%s $XBROWSER & - exit - fi - # $XBROWSER has no %s, tack URL on the end instead - $XBROWSER "$URL" & - exit - fi - echo "$0: Couldn't find the browser specified by \$BROWSER ($BROWSER)" - echo "$0: Trying some others..." -fi - -# Launcher the default GNOME browser. -if [ ! -z "$GNOME_DESKTOP_SESSION_ID" ] && which gnome-open >/dev/null; then - gnome-open "$URL" & - exit -fi - -# Launch the default KDE browser. -if [ ! -z "$KDE_FULL_SESSION" ] && which kfmclient >/dev/null; then - kfmclient openURL "$URL" & - exit -fi - -# List of browser commands that will be tried in the order listed. x-www-browser -# will be tried first, which is a debian alternative. -BROWSER_COMMANDS=" \ - x-www-browser \ - google-chrome-stable \ - google-chrome \ - chromium \ - firefox \ - mozilla-firefox \ - iceweasel \ - iceape \ - opera \ - epiphany-browser \ - epiphany-gecko \ - epiphany-webkit \ - epiphany \ - mozilla \ - seamonkey \ - galeon \ - dillo \ - netscape" -for browser_cmd in $BROWSER_COMMANDS; do - if which $browser_cmd >/dev/null; then - $browser_cmd "$URL" & - exit - fi -done - -echo '$0: Failed to find a known browser. Please consider setting the $BROWSER environment variable.' -exit 1 diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 0021e6e6fd634dbae185da94e19f73a7e6f55335..b00d5f88f01ff35d37648988f2b9a1f2f9af96e8 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -1093,7 +1093,6 @@ def construct(self): self.path("handle_secondlifeprotocol.sh") self.path("register_secondlifeprotocol.sh") self.path("refresh_desktop_app_entry.sh") - self.path("launch_url.sh") self.path("chrome_sandboxing_permissions_setup.sh") self.path("install.sh")