1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

macOS Accessibility: Fixed crash due to availability of NSAccessibilityLayoutChangedNotification on < 10.9

This commit is contained in:
ed 2021-07-05 09:49:58 +01:00
parent 3321ff231d
commit a9d17d860c

View file

@ -31,6 +31,12 @@ namespace juce
using NSAccessibilityNotificationName = NSString*;
#endif
#if (! defined MAC_OS_X_VERSION_10_9) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
const NSAccessibilityNotificationName NSAccessibilityLayoutChangedNotificationJuce = @"AXLayoutChanged";
#else
const NSAccessibilityNotificationName NSAccessibilityLayoutChangedNotificationJuce = NSAccessibilityLayoutChangedNotification;
#endif
#if JUCE_OBJC_HAS_AVAILABLE_FEATURE || (defined (MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)
#define JUCE_NATIVE_ACCESSIBILITY_INCLUDED 1
@ -1071,7 +1077,7 @@ void notifyAccessibilityEventInternal (const AccessibilityHandler& handler, Inte
{
case InternalAccessibilityEvent::elementCreated: return NSAccessibilityCreatedNotification;
case InternalAccessibilityEvent::elementDestroyed: return NSAccessibilityUIElementDestroyedNotification;
case InternalAccessibilityEvent::elementMovedOrResized: return NSAccessibilityLayoutChangedNotification;
case InternalAccessibilityEvent::elementMovedOrResized: return NSAccessibilityLayoutChangedNotificationJuce;
case InternalAccessibilityEvent::focusChanged: return NSAccessibilityFocusedUIElementChangedNotification;
case InternalAccessibilityEvent::windowOpened: return NSAccessibilityWindowCreatedNotification;
case InternalAccessibilityEvent::windowClosed: break;
@ -1095,7 +1101,7 @@ void AccessibilityHandler::notifyAccessibilityEvent (AccessibilityEvent eventTyp
case AccessibilityEvent::textChanged:
case AccessibilityEvent::valueChanged: return NSAccessibilityValueChangedNotification;
case AccessibilityEvent::titleChanged: return NSAccessibilityTitleChangedNotification;
case AccessibilityEvent::structureChanged: return NSAccessibilityLayoutChangedNotification;
case AccessibilityEvent::structureChanged: return NSAccessibilityLayoutChangedNotificationJuce;
}
return NSAccessibilityNotificationName{};