OS7: Fix calling UI API on a background thread
This occured for example whenever showing the GMM in a game and could cause various issues.
This commit is contained in:
parent
952dc3d3e1
commit
0d8b9d272c
1 changed files with 9 additions and 1 deletions
|
@ -597,5 +597,13 @@ void OSystem_iOS7::setShowKeyboard(bool show) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OSystem_iOS7::isKeyboardShown() const {
|
bool OSystem_iOS7::isKeyboardShown() const {
|
||||||
|
if ([NSThread currentThread] == [NSThread mainThread]) {
|
||||||
return [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
return [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
||||||
|
} else {
|
||||||
|
__block bool shown = false;
|
||||||
|
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||||
|
shown = [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
||||||
|
});
|
||||||
|
return shown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue