summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-09 19:29:54 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-11-20 09:19:09 +0100
commit6cdfe5ebb4f6c06bfa8b0e67e778dd68131c14e3 (patch)
tree01380d838feb9158ef40302afc041cbaba5192e0 /vcl
parentd220e476df38e86e094066a690985c624316d37f (diff)
Drop some headless mode variants
This fixes OSX "make debugrun" by dropping VCL_HIDE_WINDOWS handling and removing the internal GetPseudoHeadless() API. While at it moves the DialogCancelMode enum out of Application. Change-Id: I4876e752ddbfc39dd44faa673fb0e97810089a75 Reviewed-on: https://gerrit.libreoffice.org/61598 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/README.vars2
-rw-r--r--vcl/inc/svdata.hxx2
-rw-r--r--vcl/source/app/settings.cxx10
-rw-r--r--vcl/source/app/svapp.cxx5
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx13
-rw-r--r--vcl/source/window/dialog.cxx6
-rw-r--r--vcl/source/window/window.cxx2
-rw-r--r--vcl/win/window/salframe.cxx3
-rw-r--r--vcl/workben/commonfuzzer.hxx2
-rw-r--r--vcl/workben/fftester.cxx2
10 files changed, 16 insertions, 31 deletions
diff --git a/vcl/README.vars b/vcl/README.vars
index 0156aa76fd2b..786be8cbf166 100644
--- a/vcl/README.vars
+++ b/vcl/README.vars
@@ -14,8 +14,6 @@ VCL_DOUBLEBUFFERING_AVOID_PAINT - don't paint the buffer, useful to see where we
VCL_DOUBLEBUFFERING_FORCE_ENABLE - enable double buffered painting
VCL_DOUBLEBUFFERING_ENABLE - enable a safe subset of double buffered painting (currently in Writer, not in any other applications)
-VCL_HIDE_WINDOWS - don't draw windows
-
VCL_DEBUG_DISABLE_PDFCOMPRESSION - disable compression in the PDF writer
Gtk+
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 5ae913a0dbca..21ca3567b56a 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -153,7 +153,7 @@ struct ImplSVAppData
bool mbInAppExecute = false; // is Application::Execute() on stack
bool mbAppQuit = false; // is Application::Quit() called
bool mbSettingsInit = false; // true: Settings are initialized
- Application::DialogCancelMode meDialogCancel = Application::DialogCancelMode::Off; // true: All Dialog::Execute() calls will be terminated immediately with return false
+ DialogCancelMode meDialogCancel = DialogCancelMode::Off; // true: All Dialog::Execute() calls will be terminated immediately with return false
/** Controls whether showing any IME status window is toggled on or off.
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 2dbc330b17fe..193e1155242f 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -208,7 +208,6 @@ struct ImplMiscData
TriState mnEnableATT;
bool mbEnableLocalizedDecimalSep;
TriState mnDisablePrinting;
- bool mbPseudoHeadless;
};
struct ImplHelpData
@@ -2318,10 +2317,6 @@ ImplMiscData::ImplMiscData() :
{
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
mbEnableLocalizedDecimalSep = (pEnv != nullptr);
- // Should we display any windows?
-
- // need to hardly mask here for now, needs to be adapted of course...
- mbPseudoHeadless = getenv("VCL_HIDE_WINDOWS") || comphelper::LibreOfficeKit::isActive();
}
MiscSettings::MiscSettings()
@@ -2498,11 +2493,6 @@ bool MiscSettings::GetEnableLocalizedDecimalSep() const
return mxData->mbEnableLocalizedDecimalSep;
}
-bool MiscSettings::GetPseudoHeadless() const
-{
- return mxData->mbPseudoHeadless;
-}
-
HelpSettings::HelpSettings()
: mxData(std::make_shared<ImplHelpData>())
{
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 626214690166..eeba046c39ef 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/solarmutex.hxx>
#include <osl/process.h>
@@ -1333,7 +1334,7 @@ vcl::Window* Application::GetDefDialogParent()
return nullptr;
}
-Application::DialogCancelMode Application::GetDialogCancelMode()
+DialogCancelMode Application::GetDialogCancelMode()
{
return ImplGetSVData()->maAppData.meDialogCancel;
}
@@ -1442,7 +1443,7 @@ void Application::EnableHeadlessMode( bool dialogsAreFatal )
bool Application::IsHeadlessModeEnabled()
{
- return IsDialogCancelEnabled();
+ return IsDialogCancelEnabled() || comphelper::LibreOfficeKit::isActive();
}
static bool bConsoleOnly = false;
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 6ae47184ae2e..aa876ac60688 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -972,8 +972,6 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
* There are a number of cases that these environment variables cover:
* * SAL_FORCEGL forces OpenGL independent of any other option
* * SAL_DISABLEGL or a blacklisted driver avoid the use of OpenGL if SAL_FORCEGL is not set
- * * SAL_ENABLEGL overrides VCL_HIDE_WINDOWS and the configuration variable
- * * the configuration variable is checked if no environment variable is set
*/
bSet = true;
@@ -989,17 +987,16 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
else if (bSupportsVCLOpenGL)
{
static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL");
+ static bool bHeadlessPlugin = (getenv("SAL_USE_VCLPLUGIN") &&
+ 0 == strcmp(getenv("SAL_USE_VCLPLUGIN"), "svp"));
bEnable = bEnableGLEnv;
- static bool bDuringBuild = getenv("VCL_HIDE_WINDOWS");
- if (bDuringBuild && !bEnable /* env. enable overrides */)
- bEnable = false;
- else if (officecfg::Office::Common::VCL::UseOpenGL::get())
+ if (officecfg::Office::Common::VCL::UseOpenGL::get())
bEnable = true;
- // Force disable in safe mode
- if (Application::IsSafeModeEnabled())
+ // Force disable in safe mode or when running with headless plugin
+ if (bHeadlessPlugin || Application::IsSafeModeEnabled())
bEnable = false;
bRet = bEnable;
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index d91f5aea30f0..e59deb0b685a 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -864,9 +864,9 @@ bool Dialog::ImplStartExecute()
{
switch ( Application::GetDialogCancelMode() )
{
- case Application::DialogCancelMode::Off:
+ case DialogCancelMode::Off:
break;
- case Application::DialogCancelMode::Silent:
+ case DialogCancelMode::Silent:
if (bModal && GetLOKNotifier())
{
// check if there's already some dialog being ::Execute()d
@@ -887,7 +887,7 @@ bool Dialog::ImplStartExecute()
<< "\"cancelled in silent mode");
return false;
default: // default cannot happen
- case Application::DialogCancelMode::Fatal:
+ case DialogCancelMode::Fatal:
std::abort();
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 349d4d0b5787..9212e55bef1a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2322,7 +2322,7 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
mpWindowImpl->mbSuppressAccessibilityEvents = false;
mpWindowImpl->mbPaintFrame = true;
- if (!Application::GetSettings().GetMiscSettings().GetPseudoHeadless())
+ if (!Application::IsHeadlessModeEnabled())
{
bool bNoActivate(nFlags & (ShowFlags::NoActivate|ShowFlags::NoFocusChange));
mpWindowImpl->mpFrame->Show( true, bNoActivate );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index e34600285c22..c3e2d294e155 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -812,8 +812,7 @@ namespace {
void SetForegroundWindow_Impl(HWND hwnd)
{
- static bool bUseForegroundWindow = !std::getenv("VCL_HIDE_WINDOWS");
- if (bUseForegroundWindow)
+ if (!Application::IsHeadlessModeEnabled())
SetForegroundWindow(hwnd);
}
diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index 85e772e19468..f3e2208307a8 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -120,7 +120,7 @@ void CommonInitialize(int *argc, char ***argv)
comphelper::setProcessServiceFactory( xServiceManager );
utl::ConfigManager::EnableFuzzing();
InitVCL();
- Application::SetDialogCancelMode( Application::DialogCancelMode::Silent );
+ Application::SetDialogCancelMode(DialogCancelMode::Silent);
//we don't have a de-init, so inside this leak disabled region...
//get the font info
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index e9e398b8b4c7..cbd736efe6ad 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -104,7 +104,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
InitVCL();
- Application::SetDialogCancelMode(Application::DialogCancelMode::Silent);
+ Application::SetDialogCancelMode(DialogCancelMode::Silent);
if (strcmp(argv[2], "wmf") == 0 || strcmp(argv[2], "emf") == 0)
{