1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-18 00:54:19 +00:00

Windows: Only load UIA functions when accessibility is active

This commit is contained in:
ed 2021-05-11 12:18:49 +01:00
parent 6a36af2a11
commit 70d0657f00
2 changed files with 3 additions and 11 deletions

View file

@ -60,6 +60,7 @@ public:
~AccessibilityNativeImpl()
{
accessibilityElement->invalidateElement();
--providerCount;
if (auto* wrapper = WindowsUIAWrapper::getInstanceWithoutCreating())
{
@ -68,7 +69,7 @@ public:
wrapper->disconnectProvider (provider);
if (--providerCount == 0)
if (providerCount == 0)
wrapper->disconnectAllProviders();
}
}
@ -228,11 +229,6 @@ void AccessibilityHandler::DestroyNativeImpl::operator() (AccessibilityHandler::
//==============================================================================
namespace WindowsAccessibility
{
void initialiseUIAWrapper()
{
WindowsUIAWrapper::getInstance();
}
long getUiaRootObjectId()
{
return static_cast<long> (UiaRootObjectId);
@ -243,7 +239,7 @@ namespace WindowsAccessibility
if (isStartingUpOrShuttingDown() || (handler == nullptr || ! isHandlerValid (*handler)))
return false;
if (auto* wrapper = WindowsUIAWrapper::getInstanceWithoutCreating())
if (auto* wrapper = WindowsUIAWrapper::getInstance())
{
ComSmartPtr<IRawElementProviderSimple> provider;
handler->getNativeImplementation()->QueryInterface (IID_PPV_ARGS (provider.resetAndGetPointerAddress()));

View file

@ -65,7 +65,6 @@ void* getUser32Function (const char*);
namespace WindowsAccessibility
{
void initialiseUIAWrapper();
long getUiaRootObjectId();
bool handleWmGetObject (AccessibilityHandler*, WPARAM, LPARAM, LRESULT*);
void revokeUIAMapEntriesForWindow (HWND);
@ -1380,9 +1379,6 @@ public:
parentToAddTo (parent),
currentRenderingEngine (softwareRenderingEngine)
{
// make sure that the UIA wrapper singleton is loaded
WindowsAccessibility::initialiseUIAWrapper();
callFunctionIfNotLocked (&createWindowCallback, this);
setTitle (component.getName());