Kaydet (Commit) 6cdfe5eb authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst d220e476
......@@ -2115,8 +2115,8 @@ void SAL_CALL Frame::disposing()
// notifications which we don't need here really.
// (b) Don't forget to save the old value of IsDialogCancelEnabled() to
// restore it afterwards (to not kill headless mode).
Application::DialogCancelMode old = Application::GetDialogCancelMode();
Application::SetDialogCancelMode( Application::DialogCancelMode::Silent );
DialogCancelMode old = Application::GetDialogCancelMode();
Application::SetDialogCancelMode( DialogCancelMode::Silent );
// We should be alone for ever and further dispose calls are rejected by lines before ...
// I hope it :-)
......
......@@ -631,7 +631,6 @@ public:
bool GetDisablePrinting() const;
void SetEnableLocalizedDecimalSep( bool bEnable );
bool GetEnableLocalizedDecimalSep() const;
bool GetPseudoHeadless() const;
bool operator ==( const MiscSettings& rSet ) const;
bool operator !=( const MiscSettings& rSet ) const;
......
......@@ -219,6 +219,12 @@ private:
std::vector<OUString> aData;
};
enum class DialogCancelMode {
Off, ///< do not automatically cancel dialogs
Silent, ///< silently cancel any dialogs
Fatal ///< cancel any dialogs by std::abort
};
/**
@brief Base class used mainly for the LibreOffice Desktop class.
......@@ -236,12 +242,6 @@ private:
class VCL_DLLPUBLIC Application
{
public:
enum class DialogCancelMode {
Off, ///< do not automatically cancel dialogs
Silent, ///< silently cancel any dialogs
Fatal ///< cancel any dialogs by std::abort
};
/** @name Initialization
The following functions perform initialization and deinitialization
of the application.
......
......@@ -1804,7 +1804,7 @@ bool SfxObjectShell::IsContinueImportOnFilterExceptions(const OUString& aErrMess
{
if (mbContinueImportOnFilterExceptions == undefined)
{
if (Application::GetDialogCancelMode() == Application::DialogCancelMode::Off)
if (Application::GetDialogCancelMode() == DialogCancelMode::Off)
{
// Ask the user to try to continue or abort loading
OUString aMessage = SfxResId(STR_QMSG_ERROR_OPENING_FILE);
......
......@@ -25,6 +25,11 @@ export MAX_CONCURRENCY=4
export MOZILLA_CERTIFICATE_FOLDER=0
# Avoid hanging if the cups daemon requests a password.
export SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION=1
# Default unit tests to run with the headless plugin, if not set by the user
ifeq ($(SAL_USE_VCLPLUGIN),)
SAL_USE_VCLPLUGIN := svp
export SAL_USE_VCLPLUGIN
endif
gb_CppunitTest_UNITTESTFAILED ?= $(GBUILDDIR)/platform/unittest-failed-default.sh
gb_CppunitTest_PYTHONDEPS ?= $(call gb_Library_get_target,pyuno_wrapper) $(if $(SYSTEM_PYTHON),,$(call gb_Package_get_target,python3))
......@@ -119,8 +124,8 @@ ifneq ($(gb_SUPPRESS_TESTS),)
else
$(call gb_Output_announce,$*,$(true),CUT,2)
$(call gb_Helper_abbreviate_dirs,\
$(if $(gb_CppunitTest_vcl_hide_windows),export VCL_HIDE_WINDOWS=1 && ) \
$(if $(gb_CppunitTest_vcl_show_windows),unset VCL_HIDE_WINDOWS && ) \
$(if $(and $(gb_CppunitTest__vcl_no_svp), \
$(filter svp,$(SAL_USE_VCLPLUGIN))),unset SAL_USE_VCLPLUGIN &&) \
mkdir -p $(dir $@) && \
rm -fr $@.user && cp -r $(WORKDIR)/unittest $@.user && \
$(if $(gb_CppunitTest__use_confpreinit), \
......@@ -256,15 +261,14 @@ $(call gb_CppunitTest__use_vcl,$(1),$(true))
endef
define gb_CppunitTest_use_vcl_non_headless
$(call gb_CppunitTest_get_target,$(1)) : HEADLESS :=
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest_vcl_hide_windows := $(true)
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true)
$(call gb_CppunitTest__use_vcl,$(1),$(false))
endef
define gb_CppunitTest_use_vcl_non_headless_with_windows
$(call gb_CppunitTest_get_target,$(1)) : HEADLESS :=
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest_vcl_show_windows := $(true)
$(call gb_CppunitTest_get_target,$(1)) : gb_CppunitTest__vcl_no_svp := $(true)
$(call gb_CppunitTest__use_vcl,$(1),$(false))
endef
......
......@@ -217,6 +217,8 @@ check : unitcheck slowcheck
$(call gb_Output_announce_bell)
debugrun :
export HEADLESS= && \
$(if $(filter svp,$(SAL_USE_VCLPLUGIN)),unset SAL_USE_VCLPLUGIN &&) \
$(call gb_Module_DEBUGRUNCOMMAND)
help :
......
......@@ -428,7 +428,6 @@ endef
define gb_Module_DEBUGRUNCOMMAND
printf "\nAttach the debugger to soffice.bin\n\n"
unset VCL_HIDE_WINDOWS && \
OFFICESCRIPT=`mktemp` && \
printf "$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.exe" > $${OFFICESCRIPT} && \
printf " --norestore --nologo '--accept=pipe,name=$(USER);urp;'\n" >> $${OFFICESCRIPT} && \
......
......@@ -17,9 +17,6 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
# to avoid flashing windows during tests
export VCL_HIDE_WINDOWS=1
gb_SDKDIR := $(MACOSX_SDK_PATH)
ifeq (PRE_9_1_0,$(shell test $(CLANGVER) -lt 90100 && echo PRE_9_1_0))
......
......@@ -10,9 +10,6 @@
# to block heavy exception handling that try to acquire the solarmutex
export LO_LEAN_EXCEPTION=1
# to avoid flashing windows during tests
export VCL_HIDE_WINDOWS=1
gb_LICENSE := license.txt
gb_README = readme_$(1).txt
......
......@@ -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+
......
......@@ -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.
......
......@@ -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>())
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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 );
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment