From ab7b711c1fda6b04ecb47087c8e9237a1f662cad Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Sat, 7 Sep 2019 20:44:34 +0300 Subject: [PATCH] [ios] fix broken touch input after closing keyboard on iOS 13 --- xbmc/platform/darwin/ios/IOSKeyboardView.mm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xbmc/platform/darwin/ios/IOSKeyboardView.mm b/xbmc/platform/darwin/ios/IOSKeyboardView.mm index 90b0014d2c1de..e706388825228 100644 --- a/xbmc/platform/darwin/ios/IOSKeyboardView.mm +++ b/xbmc/platform/darwin/ios/IOSKeyboardView.mm @@ -245,18 +245,17 @@ - (void) doDeactivate:(NSDictionary *)dict // give back the control to whoever [_textField resignFirstResponder]; - // always called in the mainloop context - // detach the keyboard view from our main controller - [g_xbmcController deactivateKeyboard:self]; + // delay closing view until text field finishes resigning first responder + dispatch_async(dispatch_get_main_queue(), ^{ + // always called in the mainloop context + // detach the keyboard view from our main controller + [g_xbmcController deactivateKeyboard:self]; - // until keyboard did hide, we let the calling thread break loop - if (0 == _keyboardIsShowing) - { // no more notification we want to receive. [[NSNotificationCenter defaultCenter] removeObserver: self]; keyboardFinishedEvent.Set(); - } + }); } - (void) deactivate