mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
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
@ -597,5 +597,13 @@ void OSystem_iOS7::setShowKeyboard(bool show) {
|
||||
}
|
||||
|
||||
bool OSystem_iOS7::isKeyboardShown() const {
|
||||
return [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
||||
if ([NSThread currentThread] == [NSThread mainThread]) {
|
||||
return [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
||||
} else {
|
||||
__block bool shown = false;
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
shown = [[iOS7AppDelegate iPhoneView] isKeyboardShown];
|
||||
});
|
||||
return shown;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user