[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - include/vcl solenv/gbuild vcl/source

Norbert Thiebaud nthiebaud at gmail.com
Mon Jun 30 06:58:22 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 752a36457f6cddc5265a2d5f60157fd625f56b02
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
    
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    
    Conflicts:
    	vcl/source/window/window.cxx
    
    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 4174d5a..97b05d0 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
@@ -2341,6 +2342,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 )
@@ -2348,6 +2351,7 @@ ImplMiscData::ImplMiscData( const ImplMiscData& rData )
     mnEnableATT                 = rData.mnEnableATT;
     mnDisablePrinting           = rData.mnDisablePrinting;
     mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep;
+    mbPseudoHeadless = rData.mbPseudoHeadless;
 }
 
 MiscSettings::MiscSettings()
@@ -2535,6 +2539,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 b77447c..fff59e5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -5259,8 +5259,11 @@ void Window::Show( bool bVisible, sal_uInt16 nFlags )
             mpWindowImpl->mbSuppressAccessibilityEvents = false;
 
             mpWindowImpl->mbPaintFrame = true;
-            bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? sal_True : sal_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