diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/source/desktopdetect/desktopdetector.cxx | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/vcl/unx/source/desktopdetect/desktopdetector.cxx b/vcl/unx/source/desktopdetect/desktopdetector.cxx index dce25af71ca9..3d2fb95866fc 100644 --- a/vcl/unx/source/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/source/desktopdetect/desktopdetector.cxx @@ -42,6 +42,7 @@ #include "osl/thread.h" #include <unistd.h> +#include <string.h> using namespace rtl; @@ -279,23 +280,31 @@ VCL_DLLPUBLIC rtl::OUString get_desktop_environment() { // get display to connect to const char* pDisplayStr = getenv( "DISPLAY" ); - int nParams = osl_getCommandArgCount(); - OUString aParam; - OString aBParm; - for( int i = 0; i < nParams; i++ ) + + const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" ); + + if (pUsePlugin && (strcmp(pUsePlugin, "svp") == 0)) + pDisplayStr = NULL; + else { - osl_getCommandArg( i, &aParam.pData ); - if( aParam.equalsAscii( "-headless" ) ) - { - pDisplayStr = NULL; - break; - } - if( i < nParams-1 && (aParam.equalsAscii( "-display" ) || aParam.equalsAscii( "--display" )) ) + int nParams = osl_getCommandArgCount(); + OUString aParam; + OString aBParm; + for( int i = 0; i < nParams; i++ ) { - osl_getCommandArg( i+1, &aParam.pData ); - aBParm = OUStringToOString( aParam, osl_getThreadTextEncoding() ); - pDisplayStr = aBParm.getStr(); - break; + osl_getCommandArg( i, &aParam.pData ); + if( aParam.equalsAscii( "-headless" ) ) + { + pDisplayStr = NULL; + break; + } + if( i < nParams-1 && (aParam.equalsAscii( "-display" ) || aParam.equalsAscii( "--display" )) ) + { + osl_getCommandArg( i+1, &aParam.pData ); + aBParm = OUStringToOString( aParam, osl_getThreadTextEncoding() ); + pDisplayStr = aBParm.getStr(); + break; + } } } |