summaryrefslogtreecommitdiffstats
path: root/vcl/unx/generic/desktopdetect/desktopdetector.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/generic/desktopdetect/desktopdetector.cxx')
-rw-r--r--vcl/unx/generic/desktopdetect/desktopdetector.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 601ccafedd26..1e4636ee69a8 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -33,10 +33,11 @@
#include <X11/Xatom.h>
#include <tools/postx.h>
+#include "rtl/process.h"
#include "rtl/ustrbuf.hxx"
#include "osl/module.h"
-#include "osl/process.h"
#include "osl/thread.h"
+#include "vcl/svapp.hxx"
#include "vclpluginapi.h"
@@ -251,22 +252,17 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" );
- if (pUsePlugin && (strcmp(pUsePlugin, "svp") == 0))
+ if ((pUsePlugin && (strcmp(pUsePlugin, "svp") == 0))
+ || Application::IsHeadlessModeRequested())
pDisplayStr = NULL;
else
{
- int nParams = osl_getCommandArgCount();
+ int nParams = rtl_getAppCommandArgCount();
OUString aParam;
OString aBParm;
for( int i = 0; i < nParams; i++ )
{
- osl_getCommandArg( i, &aParam.pData );
- if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-headless" ) ) ||
- aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--headless" ) ) )
- {
- pDisplayStr = NULL;
- break;
- }
+ rtl_getAppCommandArg( i, &aParam.pData );
if( i < nParams-1 && (aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--display" ) )) )
{
osl_getCommandArg( i+1, &aParam.pData );