[Libreoffice-commits] core.git: desktop/source include/vcl vcl/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Mon Oct 17 09:33:30 UTC 2016


 desktop/source/app/app.cxx         |    3 ++-
 desktop/source/app/appinit.cxx     |    4 ++++
 include/vcl/svapp.hxx              |    6 ++++++
 vcl/source/app/svapp.cxx           |   12 ++++++++++++
 vcl/source/opengl/OpenGLHelper.cxx |    4 ++++
 5 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit 2f57632672fa2cd21c9b0113e7a5f8bd033157c4
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Mon Oct 17 08:57:46 2016 +0200

    Force disable OpenGL in Safe Mode
    
    Change-Id: I3f19231d9a9168499d9f9ed970d4da1a69cca36a
    Reviewed-on: https://gerrit.libreoffice.org/29959
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 6396a23..eb48be0 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -2088,8 +2088,9 @@ void Desktop::OpenClients()
     bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless()  );
 
     // Enter safe mode if requested
-    if (rArgs.IsSafeMode() || sfx2::SafeMode::hasFlag())
+    if (Application::IsSafeModeEnabled()) {
         handleSafeMode();
+    }
 
 
 #if HAVE_FEATURE_BREAKPAD
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 105ade3..3ea2482 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -53,6 +53,7 @@
 #include <unotools/tempfile.hxx>
 #include <vcl/svapp.hxx>
 #include <unotools/pathoptions.hxx>
+#include <sfx2/safemode.hxx>
 #include <map>
 
 using namespace desktop;
@@ -96,6 +97,9 @@ void Desktop::RegisterServices(Reference< XComponentContext > const & context)
         // interpret command line arguments
         CommandLineArgs& rCmdLine = GetCommandLineArgs();
 
+        if (rCmdLine.IsSafeMode() || sfx2::SafeMode::hasFlag())
+            Application::EnableSafeMode();
+
         // Headless mode for FAT Office, auto cancels any dialogs that popup
         if (rCmdLine.IsEventTesting())
             Application::EnableEventTestingMode();
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 4ac5084..2886cb5 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1282,6 +1282,12 @@ public:
     */
     static bool                 IsEventTestingModeEnabled();
 
+    /** Set safe mode to enabled */
+    static void                 EnableSafeMode();
+
+    /** Determines if safe mode is enabled */
+    static bool                 IsSafeModeEnabled();
+
     ///@}
 
     /** @name IME Status Window Control
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index b394c53..e1336ab 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1646,6 +1646,18 @@ void Application::EnableEventTestingMode()
     bEventTestingMode = true;
 }
 
+static bool bSafeMode = false;
+
+bool Application::IsSafeModeEnabled()
+{
+    return bSafeMode;
+}
+
+void Application::EnableSafeMode()
+{
+    bSafeMode = true;
+}
+
 void Application::ShowNativeErrorBox(const OUString& sTitle  ,
                                      const OUString& sMessage)
 {
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 45f8f76..f07e7dc 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -1024,6 +1024,10 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
         else if (officecfg::Office::Common::VCL::UseOpenGL::get())
             bEnable = true;
 
+        // Force disable in safe mode
+        if (Application::IsSafeModeEnabled())
+            bEnable = false;
+
         bRet = bEnable;
     }
 


More information about the Libreoffice-commits mailing list