Skip to content

Commit 29acb49

Browse files
Merge branch 'bugfix-13659' into release-6.6.4
2 parents 3024805 + 6307b9f commit 29acb49

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

docs/notes/bugfix-13659.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# When Voice Over is turned on, you cannot interact with LC stacks

engine/src/mbliphoneapp.mm

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,8 @@ - (id)init
15781578

15791579
- (void)dealloc
15801580
{
1581+
// PM-2014-10-13: [[ Bug 13659 ]] Remove the observer
1582+
[[NSNotificationCenter defaultCenter] removeObserver:self];
15811583
[m_root_view release];
15821584

15831585
[super dealloc];
@@ -1613,6 +1615,12 @@ - (void)loadView
16131615
- (void)viewDidLoad;
16141616
{
16151617
MCLog("MainViewController: viewDidLoad\n");
1618+
1619+
// PM-2014-10-13: [[ Bug 13659 ]] Make sure we can interact with the LC app when Voice Over is enabled/disabled while our view is already onscreen
1620+
[[NSNotificationCenter defaultCenter] addObserver:self
1621+
selector:@selector(voiceOverStatusChanged)
1622+
name:UIAccessibilityVoiceOverStatusChanged
1623+
object:nil];
16161624
}
16171625

16181626
- (void)viewDidUnload;
@@ -1704,6 +1712,24 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO
17041712
m_current_orientation = m_pending_orientation;
17051713
}
17061714

1715+
// PM-2014-10-13: [[ Bug 13659 ]] Make sure we can interact with the LC app when Voice Over is enabled/disabled while our view is already onscreen
1716+
- (void)voiceOverStatusChanged
1717+
{
1718+
UIView *t_main_view;
1719+
t_main_view = [[MCIPhoneApplication sharedApplication] fetchMainView];
1720+
1721+
if (UIAccessibilityIsVoiceOverRunning())
1722+
{
1723+
t_main_view.isAccessibilityElement = YES;
1724+
[t_main_view setAccessibilityTraits:UIAccessibilityTraitAllowsDirectInteraction];
1725+
}
1726+
else
1727+
{
1728+
[t_main_view setAccessibilityTraits:UIAccessibilityTraitNone];
1729+
t_main_view.isAccessibilityElement = NO;
1730+
}
1731+
}
1732+
17071733
@end
17081734

17091735
////////////////////////////////////////////////////////////////////////////////
@@ -1715,7 +1741,20 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO
17151741

17161742
UIView *MCIPhoneGetView(void)
17171743
{
1718-
return [[MCIPhoneApplication sharedApplication] fetchMainView];
1744+
// PM-2014-10-13: [[ Bug 13659 ]] Make sure we can interact with the LC app when Voice Over is turned on
1745+
// This only takes care of situations where VoiceOver is in use when our view loads.
1746+
// In case Voice Over is activated or disabled when our view is already onscreen,
1747+
// we need to register an observer for the notification in the viewDidLoad method
1748+
UIView *t_main_view;
1749+
t_main_view = [[MCIPhoneApplication sharedApplication] fetchMainView];
1750+
1751+
if (UIAccessibilityIsVoiceOverRunning())
1752+
{
1753+
t_main_view.isAccessibilityElement = YES;
1754+
[t_main_view setAccessibilityTraits:UIAccessibilityTraitAllowsDirectInteraction];
1755+
}
1756+
1757+
return t_main_view;
17191758
}
17201759

17211760
UIView *MCIPhoneGetRootView(void)

0 commit comments

Comments
 (0)