summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-01-16 14:59:16 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-02-12 20:29:08 +0100
commit6047341fd5933ba96a07a0fc7c4b8ae1fb0e73d5 (patch)
treebfa3bdc60c6456769773778b9312ad261a3702c3 /vcl
parent033aaeec9ee6d7ab78690054ebf1ad8af5e3eff3 (diff)
EnableAttachThreadInputHack can be a normal bootstrap variable
(For simplicity, only treat a value of exactly "true" as enabling it, not whatever else the original Boost property_tree code might have considered as equivalent to "true".) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162189 Tested-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> (cherry picked from commit b5ed6906bd215f1338ae49e33d484350a26cb25f) Conflicts: vcl/win/window/salframe.cxx Change-Id: I616c5d838d2b9046b3a92e01ebb68fc6deb37024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163253 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/window/salframe.cxx39
1 files changed, 6 insertions, 33 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 313ae0ffcf2d..121596eb5b8c 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -32,12 +32,7 @@
#include <comphelper/windowserrorstring.hxx>
-#include <fstream>
-#include <boost/property_tree/ptree.hpp>
-#include <boost/property_tree/ini_parser.hpp>
-#include <osl/file.hxx>
-#include <osl/process.h>
-
+#include <rtl/bootstrap.hxx>
#include <rtl/character.hxx>
#include <rtl/string.h>
#include <rtl/ustring.h>
@@ -1951,33 +1946,11 @@ void WinSalFrame::SetAlwaysOnTop( bool bOnTop )
static bool EnableAttachThreadInputHack()
{
- OUString aBootstrapUri;
- if (osl_getProcessWorkingDir(&aBootstrapUri.pData) != osl_Process_E_None)
- return false;
- aBootstrapUri += "/bootstrap.ini";
-
- OUString aSystemFileName;
- if (osl::FileBase::getSystemPathFromFileURL(aBootstrapUri, aSystemFileName) != osl::FileBase::E_None)
- return false;
- if (aSystemFileName.getLength() > MAX_PATH)
- return false;
-
- // this uses the Boost ini parser, instead of tools::Config, as we already use it to read other
- // values from bootstrap.ini in desktop/win32/source/loader.cxx, because that watchdog process
- // can't access LO libs. This way the handling is consistent.
- try
- {
- boost::property_tree::ptree pt;
- std::ifstream aFile(o3tl::toW(aSystemFileName.getStr()));
- boost::property_tree::ini_parser::read_ini(aFile, pt);
- const bool bEnabled = pt.get("Win32.EnableAttachThreadInputHack", false);
- SAL_WARN_IF(bEnabled, "vcl", "AttachThreadInput hack is enabled. Watch out for deadlocks!");
- return bEnabled;
- }
- catch (...)
- {
- return false;
- }
+ OUString s("$EnableAttachThreadInputHack");
+ rtl::Bootstrap::expandMacros(s);
+ const bool bEnabled = s == "true";
+ SAL_WARN_IF(bEnabled, "vcl", "AttachThreadInput hack is enabled. Watch out for deadlocks!");
+ return bEnabled;
}
static void ImplSalToTop( HWND hWnd, SalFrameToTop nFlags )