[Libreoffice-commits] core.git: include/vcl solenv/gbuild vcl/source
Norbert Thiebaud
nthiebaud at gmail.com
Mon Jun 30 03:16:30 PDT 2014
include/vcl/settings.hxx | 1 +
solenv/gbuild/platform/macosx.mk | 3 +++
vcl/source/app/settings.cxx | 9 +++++++++
vcl/source/window/window.cxx | 7 +++++--
4 files changed, 18 insertions(+), 2 deletions(-)
New commits:
commit c403286de572272ac7d2f1f1012d69d058f7e4f3
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Sun Jun 29 23:42:32 2014 +0200
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
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 0a6c6e9..021161f 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -588,6 +588,7 @@ 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;
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 8d6f834..a40e054 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -17,6 +17,9 @@
# 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)
include $(GBUILDDIR)/platform/com_GCC_defs.mk
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 1e6050c..d93ffe9 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 396b66e..7fb93e2 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;
More information about the Libreoffice-commits
mailing list