summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-06-29 23:42:32 +0200
committerMichael Meeks <michael.meeks@collabora.com>2014-06-30 11:14:12 +0100
commitc403286de572272ac7d2f1f1012d69d058f7e4f3 (patch)
tree2f8bcfba37d0daad95bc214ab8c1292c14954e94 /vcl
parentbc73014e16bf0ae3c19d68b3219dee0b7e3ab2bc (diff)
use VCL_HIDE_WINDOWS env on Mac to 'simulate' headless mode on Mac
Building, and running the unit/subsequent test on Mac cause massive amount of flashing windows creation/destruction that make building with test very annoying on a box used for other purposes. This patch prevent the windows to be actually displayed hence mitigating the problem Change-Id: Ied2a36699b50856e0c4e6b618212481796ec99d3
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/settings.cxx9
-rw-r--r--vcl/source/window/window.cxx7
2 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 1e6050ce1ae0..d93ffe98de32 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -213,6 +213,7 @@ struct ImplMiscData
TriState mnEnableATT;
bool mbEnableLocalizedDecimalSep;
TriState mnDisablePrinting;
+ bool mbPseudoHeadless;
};
struct ImplHelpData
@@ -2345,6 +2346,8 @@ ImplMiscData::ImplMiscData()
mnDisablePrinting = TRISTATE_INDET;
static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI
mbEnableLocalizedDecimalSep = (pEnv != NULL);
+ pEnv = getenv("VCL_HIDE_WINDOWS"); // do not display any windows
+ mbPseudoHeadless = (pEnv != NULL);
}
ImplMiscData::ImplMiscData( const ImplMiscData& rData )
@@ -2352,6 +2355,7 @@ ImplMiscData::ImplMiscData( const ImplMiscData& rData )
mnEnableATT = rData.mnEnableATT;
mnDisablePrinting = rData.mnDisablePrinting;
mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep;
+ mbPseudoHeadless = rData.mbPseudoHeadless;
}
MiscSettings::MiscSettings()
@@ -2539,6 +2543,11 @@ bool MiscSettings::GetEnableLocalizedDecimalSep() const
return mpData->mbEnableLocalizedDecimalSep;
}
+bool MiscSettings::GetPseudoHeadless() const
+{
+ return mpData->mbPseudoHeadless;
+}
+
ImplHelpData::ImplHelpData()
{
mnTipDelay = 500;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 396b66ef778f..7fb93e28dd12 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2414,8 +2414,11 @@ void Window::Show( bool bVisible, sal_uInt16 nFlags )
mpWindowImpl->mbSuppressAccessibilityEvents = false;
mpWindowImpl->mbPaintFrame = true;
- bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? true : false;
- mpWindowImpl->mpFrame->Show( true, bNoActivate );
+ if (!Application::GetSettings().GetMiscSettings().GetPseudoHeadless())
+ {
+ bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? true : false;
+ mpWindowImpl->mpFrame->Show( true, bNoActivate );
+ }
if( aDogTag.IsDead() )
return;