Skip to content

Commit 77da476

Browse files
warmenhovenLibretroAdmin
authored andcommitted
macos: default Accessibility on if VoiceOver is on
1 parent a6c82df commit 77da476

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

configuration.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#include "switch_performance_profiles.h"
7171
#endif
7272

73-
#if IOS
73+
#if __APPLE__
7474
#include "ui/drivers/cocoa/apple_platform.h"
7575
#endif
7676

@@ -2880,7 +2880,7 @@ void config_set_defaults(void *data)
28802880
load_timezone(settings->arrays.timezone);
28812881
#endif
28822882

2883-
#if IOS
2883+
#if __APPLE__
28842884
configuration_set_bool(settings,
28852885
settings->bools.accessibility_enable, RAIsVoiceOverRunning());
28862886
#endif

ui/drivers/cocoa/apple_platform.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#ifndef COCOA_APPLE_PLATFORM_H
22
#define COCOA_APPLE_PLATFORM_H
33

4-
#if TARGET_OS_IPHONE
5-
/* this comes from UIKit but you cannot #include UIKit from C */
64
extern bool RAIsVoiceOverRunning(void);
7-
#endif
85

96
#if TARGET_OS_TV
107
#include "config_file.h"

ui/drivers/cocoa/cocoa_common.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ extern bool RAIsVoiceOverRunning(void)
6262
{
6363
return UIAccessibilityIsVoiceOverRunning();
6464
}
65+
#elif OSX
66+
#import <AppKit/AppKit.h>
67+
extern bool RAIsVoiceOverRunning(void)
68+
{
69+
if (@available(macOS 10.13, *))
70+
return [[NSWorkspace sharedWorkspace] isVoiceOverEnabled];
71+
return false;
72+
}
6573
#endif
6674

6775
#if defined(HAVE_COCOA_METAL) || defined(HAVE_COCOATOUCH)

0 commit comments

Comments
 (0)