vcl/source/app/settings.cxx | 2 +- vcl/win/window/salframe.cxx | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
New commits: commit 3244668b05ecb5eeda8e4758359eae597dbd0821 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Nov 27 10:26:55 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Nov 27 09:45:44 2024 +0100 Reuse SAL_ACCESSIBILITY_ENABLED to allow disabling a11y on Windows After commit c5b6e3ac564c35aa10744d498b372fa5d4f68bf3 (win a11y: Stop using setting to indicate AT support, 2024-10-30), the a11y status doesn't depend on a setting, and will be enabled whenever anything on Windows sends a WM_GETOBJECT messaage to a window. To allow debugging without a11y interference, use the existing SAL_ACCESSIBILITY_ENABLED environment variable, and extend it to use its "0" value to disable. Change-Id: I43bdec59a195ace3f704206d9ebe07352dd3e819 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177385 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 518402fda580..ad15bd3e68a3 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2709,7 +2709,7 @@ bool MiscSettings::GetEnableATToolSupport() { static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED"); if (pEnv && *pEnv) - return true; + return pEnv[0] != '0'; ImplSVData* pSVData = ImplGetSVData(); return pSVData->mxAccessBridge.is(); diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index dbbffe73b27b..751e85012bff 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -5692,6 +5692,13 @@ static void ImplHandleIMENotify( HWND hWnd, WPARAM wParam ) static bool ImplHandleGetObject(HWND hWnd, LPARAM lParam, WPARAM wParam, LRESULT & nRet) { + static const bool disable = [] + { + const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED"); + return pEnv && pEnv[0] == '0'; + }(); + if (disable) + return false; uno::Reference<accessibility::XMSAAService> xMSAA; if (ImplSalYieldMutexTryToAcquire()) {