summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-23 09:04:43 +0200
committerGitHub <noreply@github.com>2019-08-23 09:04:43 +0200
commitde6783eaca9c6d95f02b6998ac63eaa622bac19a (patch)
treea196c5bf075794949b456b9683566a0048a23b40
parent73f1f9b44ffa0ab64326e2158d859c78c12a32fc (diff)
parente0df9de0cb307b415e23a5157092eb5c8334c6b0 (diff)
Merge pull request #31543 from fogine/#31503-ios-touch-events-stolen
Fixes iOS>=11 stealing touch events
-rw-r--r--platform/iphone/view_controller.h4
-rw-r--r--platform/iphone/view_controller.mm12
2 files changed, 16 insertions, 0 deletions
diff --git a/platform/iphone/view_controller.h b/platform/iphone/view_controller.h
index fc18661f62..68e3bc64fc 100644
--- a/platform/iphone/view_controller.h
+++ b/platform/iphone/view_controller.h
@@ -39,6 +39,10 @@
- (void)didReceiveMemoryWarning;
+- (void)viewDidLoad;
+
+- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures;
+
- (BOOL)prefersStatusBarHidden;
@end
diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm
index 0358abf9e2..e52ad92bf2 100644
--- a/platform/iphone/view_controller.mm
+++ b/platform/iphone/view_controller.mm
@@ -83,6 +83,18 @@ int add_cmdline(int p_argc, char **p_args) {
printf("*********** did receive memory warning!\n");
};
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ if (@available(iOS 11.0, *)) {
+ [self setNeedsUpdateOfScreenEdgesDeferringSystemGestures];
+ }
+}
+
+- (UIRectEdge)preferredScreenEdgesDeferringSystemGestures {
+ return UIRectEdgeAll;
+}
+
- (BOOL)shouldAutorotate {
switch (OS::get_singleton()->get_screen_orientation()) {
case OS::SCREEN_SENSOR: